To create the service wrapper for the service, follow these steps:
- Create a new C# Class Library project named WeatherService.
- Rename the class1.cs file to WeatherService.cs.
- Create a new service reference by right-clicking on the References node in Solution Explorer and choosing Add Service Reference.
- Enter http://www.webservicex.net/globalweather.asmx?WSDL in the Address field and click on Go.
- Enter GlobalWeather in the Namespace field, and click on OK.
- Open the WeatherService.cs file and enter the following piece of code:
using System.ServiceModel; using WeatherService.GlobalWeather; namespace Contoso.Weather { public class Weather { public const string serviceAddress = "http://www.webservicex.net/globalweather.asmx"; ...