Web Service Description Language WSDL Detailed (2)

zhaozj2021-02-08  230

An example of the WSDL file allows us to study the WSDL file and look at its structure and how to work. Note that this is a very simple WSDL document instance. Our intentions are just a most significant feature. More detailed discussions are included in the following contents.

"RPC" Transport = "http://schemas.xmlsoap.org/soap/http" /> < / INPUT> < / output> The following is the sum of the instance document: I will discuss the details of each part later.

The first line stated that this document is XML. Although this is not required, it helps the XML parser decide whether to resolve the WSDL file or just an error. The second line is the root element of the WSDL document: . Some properties are affiliated to the root element, just like the sub-elements for the element.

The element contains the Types column. This column can be default if you do not need a declared data type. In the WSDL paradigm, there is no application-specific Types declaration, but I still use the Types column, just to declare Schema Namespaces.

The element contains the Messages column. If we look at the operation as a function, the element defines the parameters of that function. Each child element in the element is consistent with a parameter. The input parameters are defined in the element, isolated from the output parameters - the output parameter has its own element. Also as input, output parameters have their respective elements in the element of the input and output. Output Elements ends with "response", just as "fooresponse" used previously. Each element has a name and type property, just like a function of parameter name and parameter type. When used to exchange documents, WSDL allows the use of the element to describe the exchanged document.

The type of element can be the XSD base type, or the SOAP definition type (SOAPENC), WSDL Definition Type (WSDL) or the type defined by the Types column.

In a porttypes column, there can be zero, single or more elements. Since the abstract portType definition can be placed in a separate file, there is no element in a WSDL file. Only one element is used in the example. And a element can define one or multiple operations in the element. The example only uses a element named "foo". This is the same as a function name. Elements can have one, two, three sub-elements: , and elements. Messages in each and elements reference the relevant elements in the Message column. In this way, the entire element in the example is equivalent to the following C function:

INT foo (int Arg);

This example is full of lengthy compared to XML and C. (Including the element, XML uses 12 lines of code in the example to express the same single line function declaration.)

The Bindings column can have zero, one or more elements. Its intent is to develop each to call and respond through network. The Services column can also have zero, one, multiple elements. It also contains elements, each element references the element in a bindings bar. Bindings and Services columns include WSDL documents.

转载请注明原文地址:https://www.9cbs.com/read-1953.html

New Post(0)