Microsoft Visual Studio includes a wizard that generates a Web Service client proxy that you can use to call Web Service methods. The wizard is launched
via
.
-
Type the URL of your Web Service into the top text box, for example,
http://demo.borland.com/BorlandSampleService/BorlandSampleService.asmx?WSDL, and click
Enter.
The
Add Web Reference button is enabled when the wizard loads the WSDL document from the specified URL.
-
Click
Add Web Reference.
The wizard generates a proxy class in a namespace that is the reverse of the name of the Web server that hosts the service
(for example,
demo.host.com becomes
com.host.demo).
-
Explore objects to see which classes have been generated. Each Web Service, and all complex data types used by the Web Service
methods, are represented as classes.
In the generated proxy code, the proxy class takes its name from the Web Service. The namespace of the class is the reverse
of the name of the Web server that hosts the service. All files that are generated by the
Add Web Reference wizard are displayed on the
Solution Explorer tab.
注: The
Show All Files option must be activated to display all generated files.