web| Example | Let's look at the WSDL file, see its structure, and how it works. Please note that this is a very simple instance of a WSDL document. Our intention is only to illustrate its most salient features. The following sections include a more detailed discussion.
<service name= "Foosampleservice"
<port name= "Simpleport" binding= "wsdlns:simplebinding"
<soap:address location= "http://carlos:8080/FooSample/FooSample.asp"/>
</port>
</service>
</definitions>
The following is a general summary of the example document: I'll discuss each of the details later in detail.
The first line declares that the document is XML. Although this is not required, it helps the XML parser decide whether to parse the WSDL file or simply make an error. The second line is the root element of the WSDL document: <definitions>. Some properties are attached to the root element, just as <schema> child elements are to <types> elements.
The <types> element contains the types column. If you do not have the data type you want to declare, this column can be default. In the WSDL paradigm, there is no application-specific types declaration, but I still use the types column just to declare the schema namespaces.
The <message> element contains the messages column. If we think of an action as a function, the <message> element defines the parameters of that function. Each <part> child element in the <message> element matches a parameter. The input parameter is defined in the <message> element, separated from the output parameter-the output parameter has its own <message> element. Parameters that are both input and output have their corresponding <part> elements in the <message> elements of the input and output. The output <message> element ends with "Response", just as the "fooresponse" used previously. Each <part> element has a name and a type attribute, just as a function's argument has a parameter name and a parameter type.
When used to exchange documents, the WSDL allows you to use the <message> element to describe the exchanged document.
The <part> element's type can be either an XSD base type or a SOAP definition type (SOAPENC), a WSDL definition type (WSDL), or a type defined by the types column.
In a porttypes column, you can have 0, single, or multiple <portType> elements. Because abstract portType definitions can be placed in separate files, it is possible to have no <portType> elements in a WSDL file. In the example above, only one <portType> element is used. An <portType> element can define one or more actions in the <operation> element. The example uses only a <operation> element named "foo". This is the same as a function name. The <operation> element can have one, two, three child elements: <input>, <output>, and <fault> elements. The messages in each <input> and <output> element refer to the associated <message> element in the message bar. Thus, the entire <portType> element in the example is equivalent to the following C function:
int foo (int arg);
This example shows that XML is much more verbose than C. (including the <message> element, XML uses 12 lines of code in the example to express the same Single-line function declaration.) )
The bindings column can have 0, one, or more <binding> elements. Its intention is to make each <operation> call and respond through the network. The services bar can also have 0, one, and multiple <service> elements. It also contains <port> elements, each of which references a <binding> element in a bindings column. Both the bindings and the Services bar contain WSDL documents.
Original address: http://www.yesky.com/20011013/200759_1.shtml
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.