- /language: Allows you to specify the language used to create the proxy class. The default is C#, so its inclusion in the previous call is extraneous. You can specify CS (C#; default), VB (Visual Basic), JS (JScript), or VJS (Visual J#) as the language argument.
- /protocol: The protocol implemented in the proxy class with SOAP as the default setting. The additional options are SOAP12, HttpGet/ HttpPost, or a custom protocol.
- The url points to the Web service. It may also point to an XSD schema or .discomap document. You can obtain discovery documents for an XML Web service using the Web Services Discovery Tool (Disco.exe). The .discomap, .disco, .wsdl, and .xsd files produced by this tool can be used as input to wsdl.exe. You should refer to the wsdl.exe tool documentation for more information on the additional command-line options available.
The following line generates a proxy class using VB.NET:
wsdl /language:vb /protocol:soap
http://localhost/WebServiceExample/Service1.asmx
Listing B contains a portion of the VB.NET proxy class generated by the wsdl tool.
Listing B
With the proxy class in place, it can be utilised to test our Web service. (Note: The proxy class may be developed using the language of your choice. It doesn't have to use the same language as used in the actual Web service.)
Using the proxy class
We can utilise this proxy class in a client application to use the features of our Web service. The client application may be developed with Windows Forms, ASP.NET, or any other .NET application. The ASP.NET Web Form in Listing C utilises the proxy class and C# to retrieve products by the product id entered by the user (entered via text box on Web Form).
Listing C