Instantiating – Invoking Web Services, Creating Proxy Classes with WSDL
In this tutorial you will learn about Discovering Web Services, Instantiating and Invoking Web Services, Creating Proxy Classes with the Web Services Description Language Tool (wsdl.exe)
VB.NET 2005 Tutorials: Instantiating – Invoking Web Services, and Creating Proxy Classes with WSDL
Using the Web Services Discovery Tool (disco.exe)
Now that we have created a web service, we will use the disco.exe tool to discover it. To direct the tool to locate the service the syntax to be used is as under. This command has to be entered in the .NET framework command prompt.
disco /nosave http:vbdotnet/service.asmx
The output is also generated on to this screen.
The results can be saved to a directory on the user’s computer. The process of saving is illustrated below.
The result produced is shown below:
Instantiating and Invoking Web Services
Creating Proxy Classes with the Web Services Description Language Tool (wsdl.exe)
The .NET Framework provides wsdl.exe tool to parse Web service descriptions and generate proxy classes, which can be used by a consumer to call methods on a Web service. The out put generated can be of any of the forms given below:
.wsdl files
.xsd files
.disco files
.discomap files.
Note that the outputs are generated by disco tool. Both disco.exe and wsdl.exe are located in the same place. Just like the disco tool, wsdl.exe is also a command line application. The format for the command is given below:
Wsdl [options] {URL | Path }
The application responds by writing to the disc file and the result is shown below:
The lines of code generated by the console application wsdl.exe are given below:
Click here to view sample code