Using wsdl.exe to generate a webservice proxy class

Source: Internet
Author: User

Use wsdl.exe to generate a webservice proxy class:
Generate a webservice proxy class based on the provided wsdl
1. Start-> Program-> Visual Studio 2005 Command Prompt
2. Enter the following red parts
D:/Program Files/Microsoft Visual Studio 8/VC> wsdl/language: c #/n: TestDemo/out: d:/Temp/TestService. cs D:/Temp/TestService. wsdl
A TestService. cs file is generated under d:/Temp.
Note: D:/Temp/TestService. wsdl is the wsdl path, which can be the url path: http: // localhost/Temp/Test. asmx? Wsdl

Wsdl parameter description:
Wsdl.exe <option> <URL or path>...
-Option-
<URL or path>-
The URL or path pointing to the WSDL protocol, XSD architecture, or. discomap document.
/Nologo
Undisplay the copyright logo.
/Language: <language>
The language used to generate the proxy class. Please refer to "CS", "VB", "JS", "VJS ",
Select "CPP" or implement System. CodeDom. Compiler. CodeDomProvider
Class provides a fully qualified name. The default language is "CS" (CSharp ).
The abbreviation is "/l :".

/Sharetypes
Enable the type sharing function. This function is shared between different services.
(The namespace, name, and network signature must be the same)
Create a code file with a single type definition.
Use http: // URLs as a command line parameter to reference
Service, or create a discomap document for a local file.

/Verbose
Additional information is displayed when/sharetypes is enabled.
The abbreviation is "/v ".

/Fields
Generate fields rather than attributes. The abbreviation is "/f ".

/Order
Generates an explicit sequence identifier for a particle member.

/EnableDataBinding
Implement the INotifyPropertyChanged interface on all generated types,
To enable data binding. The abbreviation is "/edb ".

/Namespace: <namespace>
The generated proxy or template namespace. Default namespace
Is a global namespace. The abbreviation is "/n :".

/Out: <fileName | directoryPath>
The name or directory path of the generated proxy code. The default file name is from
Derived from the service name. The abbreviation is "/o :".

/Protocol: <protocol>
Rewrite the default protocol to be implemented. Refer to "SOAP", "SOAP12 ",
Select from "HttpGet" and "HttpPost.

/Username: <username>
/Password: <password>
/Domain: <domain>
The Credential used to connect to the server that requires authentication.
The abbreviations are "/u:", "/p:", and "/d :".

/Proxy: <url>
The URL of the proxy server used to process HTTP requests.
The default setting is to use the system proxy server.

/Proxyusername: <username>
/Proxypassword: <password>
/Proxydomain: <domain>
The Credential used to connect to the proxy server that requires authentication.
The abbreviations are "/pu:", "/pp:", and "/pd :".

/Appsettingurlkey: <key>
The
The default configuration item. The default value is non-slave configuration.
File. The abbreviation is "/urlkey :".

/Appsettingbaseurl: <baseurl>
The base URL used to calculate the URL segment.
You must also specify the deleettingurlkey option. The URL segment is
Calculated from appsettingbaseurl
The result of the relative URL of the URL in the WSDL document. The abbreviation is "/baseurl :".

/Parsableerrors
Output Error. The format is similar to that reported by the compiler.

-Advanced-

/Server
The server switch has been rejected. Use/serverInterface instead.
Implement Xml Web Services using protocol-based ASP. NET
Generate abstract classes. By default, a client proxy is generated.
Class.

/ServerInterface
Generate for the server side of ASP. Net Web Service
Interface. Will be generated for each binding in the wsdl document
One interface. Separate Implementation of the wsdl protocol (Implementation
The class of the interface should not include any of the following items in the class method:
Modify Web service attributes or serialization of the wsdl Protocol
Attribute ). The abbreviation is "/si ".

/Parameters: <file>
READ command line options from the specified xml file. In this way, you can
Specifies options that cannot be used in the command line. For example, select
Type of the generated asynchronous programming model. For more information,
See the tool documentation. The abbreviation is "/par :".

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.