Not logged in - Login
View History

Login Service CSharp Example

Setup

First create, in your own system, a service reference to the DPD Integration Services LoginService.

In your Visual Studio project that communicates with the service right click on 'References' and left click 'Add Service Reference'

Enter the namespace (eg: 'DIS') and and click 'Advanced...'

In this dialog click 'Add Web Reference...'

Enter https://public-dis-stage.dpd.nl/Services/LoginService.svc?wsdl in the URL field and click on the arrow button.

If the service is found, change the 'Web reference name' (eg: LoginService) and click on 'Add Reference' to add the Webservice Reference.

Next step is to add the following code in your method to retrieve the token from the service.

Code

try 
{
       string delisId = "exampleUserID";
       string password = "examplePassword";
       string messageLanguage = "en_US"; // optional
       string authToken = "";

       // create a client object
       LoginService.LoginService loginServiceClient = new LoginService.LoginService();

       // create a login object and provide the delisId and password
       LoginService.Login login = new LoginService.Login();
       login = loginServiceClient.getAuth(delisId, password, messageLanguage);

       // get the token
       authToken = login.authToken;
}
catch (SoapException e)
{
       Console.WriteLine(e.Detail["authenticationFault"]["errorCode"].InnerText);
       Console.WriteLine(e.Detail["authenticationFault"]["errorMessage"].InnerText);    
}