One of our vendors provides a web service API to allow their customers to validate data in a database. As part of their SDK, they provide a WSDL (Web Service Definition Language) file that, according to their documentation, can "be read by software applications and application development tools. An application tool such as Microsoft's Visual Studio can import a WSDL document and automatically generate software classes that access the Web Services the WSDL defines."
I'm currently using Visual Studio 2005. What do I need to do to get Visual Studio to do the magic code generation for me?
UPDATE: This wasn't obvious to me, but if you have a static WSDL file stored locally on your computer, you can just paste the file path (e.g. C:\WSDLFiles\Service.WSDL
) into the address bar of the Web Reference dialog box.
To add a Web Reference On the Project menu, click Add Web Reference. In the URL box of the Add Web Reference dialog box, type the URL to obtain the service description of the Excel Web Services, such as http://<server>/<customsite>/_vti_bin/excelservice.asmx or http://<server>/_vti_bin/excelservice.asmx .
In Solution Explorer, right-click the name of the project to add the Web service to and then click Add Web Reference. The Add Web Reference dialog box is displayed. In the URL box, enter the URL of the Web service to use.
Create the Client Program Then click on the "Advanced" button below in the left corner. Then you will see a screen like this will appear. Then click on "Add Web Reference" on the following left corner of the screen.
If you right click on the project in the solution explorer, and select “Add Web Reference…” you will get a dialog to link the WSDL file to your project. Visual Studio will then download the WSDL and generate all the stuff needed to use the interface in the IDE.
The WSDL should be exposed at the URL of their web service, you don’t link to the file they gave you. I imagine that the file is just for reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With