Datapolis Process System SDK

Search:

Contents
:
IndexBookmarkPrint
Home > WBInterface > Web Service

Web Service

 

 

Web Service allows you to manage workflows in client manner.

 

Requirements


To use WBInterface Web Service you need to have the following references in your project:

  • ​Datapolis.WorkBox.Utilities -  Useful methods for workflow managing
  • http://<Site>/_layouts/15/Datapolis.WorkBox/WBInterface.asmx - Service reference to WBInterface.asmx

The assembly can be downloaded here. You can also find it in Download section.

 

Adding Service Reference


To add service reference right-click on your project in Visual Studio and select Add -> Service Reference...

In next window provide service address and custom name for your project.

 

Note that Web Service goes with it's own namespace so remember to add using statement.

Creating Soap Client


Soap Client needs to be initialized before you can use methods provided by web service.

 

private WBInterfaceWebService.WBInterfaceSoapClient CreateSoapClient()
{
     BasicHttpBinding binding = new BasicHttpBinding();
     binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
     binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
     binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Ntlm;
     EndpointAddress address = new EndpointAddress("webServiceUrl");
   
     var client = new WBInterfaceWebService.WBInterfaceSoapClient(binding, address);
   
     client.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
     client.ClientCredentials.Windows.AllowNtlm = true;
     client.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("login", "password", "domain");
   
     return client;
}

 

After that you can invoke methods simply by calling client.MethodName

WBInterfaceWebService.WBInterfaceSoapClient client = CreateSoapClient();
WBSiteInfo wbSiteInfo = client.GetWBSiteInfo();

 

Examples


Here you will find method list with some examples. The examples are common for both Web Service and Object Model since they are invoked in very similar way.