views:

268

answers:

2

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.

+2  A: 

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.

Bremer
WSDL is not always exposed from the web service. That permits anyone to know about the service. Handing out a file to people you know is a way to control who knows about the metadata of the service.
John Saunders
A: 

Right click your web project and select 'Add web reference' and basically follow the instructions.

Dan Diplo