Create wrapper classes with C#
To create a wrapper class, you'll need to use some .NET programming language to consume an external web service. finance and operations can create a reference of the wrapper class and can access the external web service through the wrapper class.
The following code shows an example of creating a C# class library. A service reference of the SOAP web service will be set up in the class library.
using System.ServiceModel;
namespace <WebServiceProviderName>
{
public class <classname>
{
public static string <methodname>()
{
var binding = new System.ServiceModel.BasicHttpBinding();
var endpointAddress = new EndpointAddress(“SOAP web service url”);
WebServiceSoapClient client = new WebServiceSoapClient(binding, endpointAddress);
return client.<web service method name>();
}
}
}
The finance and operations apps development environment includes an element named References under Application explorer. The assembly of the wrapper class should be included in the reference. You can call the method that's created in the wrapper class directly by using the created reference.
The code will resemble the following example:
WebServiceDataProvider.<classname>::<methodname>();
You can create separate methods in the wrapper class to access all methods of the web service, which you can eventually call from finance and operations apps code wherever required.