Applications on the. NET platform can use the proxy library to invoke methods on the Web service, which makes it easy to use Web services. The first step in building a proxy library is to generate a proxy class for a Web service from SDL. The. NET SDK provides a tool called WebServiceUtil.exe that helps us generate a proxy class. To generate a proxy class for a Web service, first enter the command-line environment, then go to the directory where the client application will be developed, and then enter the following command:
After the above command is executed, a C # source code file is generated in the directory where the command is run, called DailyStock.cs (remember that the name of the Web service class is also Dailystock). Now look at the meaning of these arguments:
L/c:proxy: Tell Webserviceutil to generate a proxy class
L/PA:HTTP://LOCALHOST/STOCKQUOTE/STOCKQUOTE.ASMX?SDL: Provides SDL with a path to Web services. If you have already saved SDL on the Web service to your hard disk, we can even provide a local path to the SDL file.
L/n:quotes: Tell Webserviceutil to put the proxy class in the quotes namespace. This is done to make it easier to manage and use the agent library.
When the agent library is ready, we use the C # compiler to generate a proxy library from the proxy class that we just created in the previous steps:
When generating the agent library, we used the/target:library switch to indicate that we wanted to output a library file. We also cite some collections that have been used in Web services. The compiler will build a DLL library named DailyStock.dll in the directory where the command is run.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.