Example of SOAP link with Visual Studio 2008

Modified on Fri, 24 Dec 2021 at 10:29 AM

Instructions for establishing a SOAP link with the Yuki API in Visual Studio 2008

  • Start Visual Studio 2008 and create a new project of type Windows forms applicatie.
  • Right-click the project name in the Solution Explorer and then click Add Service Reference...
  • Enter the URL of the web service and click Go.
  • When the web service is found and the WSDL is loaded, a treeview will be loaded from which you can conclude that the web service supports HTTPPOST and SOAP.
  • Enter the desired name of the namespace in the text field under the Namespace heading.
  • The fact that several methods are supported in order to work with the web service is important in 'Visual Studio 2008'. While programming you need the name of the method that .NET must use during the execution. This is the socalled 'endpoint' that you communicate with. The 'endpoint' can be found in a configuration file that is automatically generated after the completion of the previous Wizard. By default this file will not be shown. You can make this file visible by clicking Show All Files in the Solution Explorer.
  • Open the 'configuration.svc' info file from the 'Solution Explorer'. In this XML file you have to search for the section with the 'endpoints'.
  • Search for the attribute name in both 'endpoint' elements. In the name you will find the 'AccountingSoap' and 'AccountingSoap12' values. This indicates that the web service supports 'SOAP 1.1' and 'SOAP 1.2'. You can now close the XML file.
  • Then create a form that contains a button and a textbox in which you can enter the Web service access code (WebserviceAccessKey).
  • Double-click in the form editor in order to automatically generate code for a button click event handler. 
  • Always put the code that calls web service methods in a 'try...Catch block.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article