How to do it...

To create the service wrapper for the service, follow these steps:

  1. Create a new C# Class Library project named WeatherService.
  2. Rename the class1.cs file to WeatherService.cs.
  3. Create a new service reference by right-clicking on the References node in Solution Explorer and choosing Add Service Reference.
  1. Enter http://www.webservicex.net/globalweather.asmx?WSDL in the Address field and click on Go.
  2. Enter GlobalWeather in the Namespace field, and click on OK.
  3. 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"; ...

Get Extending Microsoft Dynamics 365 for Operations Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.