Talk about WebService Development-Application Chapter (iii)-teach you how to look at WSDL documents

Source: Internet
Author: User
Tags wsdl

As a WebService client development, in the daily work may often get a WSDL address or document provided by the other side, then get this address how we write the client call code, the previous few just in the way of personal experience written down, Then it is really necessary to understand the WSD documentation to write the client-side calling code based on the WSDL document. The following is a combination of the previous demo to drill down into the WSDL document, and finally illustrated in a graphical manner.

This article takes the previous SayHello demo to analyze several parts of the WSDL document, personally think that can be divided into 6 parts, the following respectively:

<definitions/>

This part of the basic article has been introduced, the main description of the reference to the schema and the location of the schema, you can see the introduction of the basic article, SayHello Demo This part of the content is as follows:

<wsdl:definitions xmlns:xsd= "Http://www.w3.org/2001/XMLSchema" xmlns:wsdl= "http://schemas.xmlsoap.org/wsdl/" xmlns:tns= "http://impl.service.server.ws.devins.com/" xmlns:soap= "http://schemas.xmlsoap.org/wsdl/soap/" xmlns: Ns2= "Http://schemas.xmlsoap.org/soap/http" xmlns:ns1= "http://service.server.ws.devins.com/" Name= " Sayhelloimplservice "targetnamespace=" http://impl.service.server.ws.devins.com/">

<types/>

         <!--types Schema: Constraint XML format element: Used to specify tags in XML <sayhello></sayhe Llo> <sayHelloResponse></sayHelloResponse> ComplexType: Description is a composite type request <sayh ello> <arg0>string</arg0> </sayhello> Response <sayHelloResponse> <return>string&lt ;/return> </sayHelloResponse>     Look back at the core of the demo request and response <q0:sayHello> <arg0&              gt;devins</arg0> </q0:sayHello> <ns2:sayhelloresponse "> <return>Hello:devins</return> </ns2:sayHelloResponse>--&GT;&LT;WSDL:TYPES&G T;<xs:schema xmlns:xs= "Http://www.w3.org/2001/XMLSchema" xmlns:tns= "http://service.server.ws.devins.com/" elementformdefault= "Unqualified" targetnamespace= "http://service.server.ws.devins.com/" version= "1.0" &GT;&LT;XS: Element name= "SayHello" type= "Tns:sayhello"/><xs:element name= "Sayhelloresponse" type= "Tns:sayhelloresponse"/><xs:complextype name= "SayHello" >< Xs:sequence><xs:element minoccurs= "0" name= "arg0" type= "xs:string"/&GT;&LT;/XS:SEQUENCE&GT;&LT;/XS: Complextype><xs:complextype name= "Sayhelloresponse" ><xs:sequence><xs:element minOccurs= "0" name = "return" type= "xs:string"/></xs:sequence></xs:complextype></xs:schema></wsdl:types>

<message/>

<!--message: Used to define a SOAP message structure part: The meaning of the section/composition is actually referring to the constraint format in the schema above--><wsdl:message name= "Sayhelloresponse" ><wsdl:part element= "Ns1:sayhelloresponse" name= "parameters"/></wsdl:message><wsdl:message name = "SayHello" ><wsdl:part element= "Ns1:sayhello" name= "parameters"/></wsdl:message>

<portType/>

<!--PortType: Used to specify the server-side SEI (interface) operation: Represents the action/behavior, the method defined in the SEI input: Input output of method SayHello: The output input and output of method SayHello refers to the definition of the above message--><wsdl:porttype name= "Isayhello" ><wsdl:operation name= "SayHello" ><wsdl:input message= "Ns1:sayhello" name= "SayHello"/><wsdl:output message= "Ns1:sayhelloresponse" name= "Sayhelloresponse"/></wsdl:operation></wsdl:porttype>

<binding/>

<!--binding: Used to specify the implementation class of the SEI Type property: reference <portType> definition <soap:binding style= "document";: Represents a document (XML) for transmission <input><output> the same as in the previous section <soap:body use= "literal"/>: Indicates that the body transmits text in text-as-XML format--><wsdl:binding Name= "sayhelloimplservicesoapbinding" type= "Ns1:isayhello" ><soap:binding style= "document" Transport= "http:/ /schemas.xmlsoap.org/soap/http "/><wsdl:operation name=" SayHello "><soap:operation soapAction=" "style= "Document"/><wsdl:input name= "SayHello" ><soap:body use= "literal"/></wsdl:input><wsdl:o Utput name= "Sayhelloresponse" ><soap:body use= "literal"/></wsdl:output></wsdl:operation>< /wsdl:binding>

<service>


<!--service: Same as WebService container, can also be understood as a factory Name: Container class/factory class for specifying clients, client code starts with this class port: Used to specify a portal on the server side (the implementation class corresponding to the SEI) port Binding: Reference the port name defined above: the container obtains the implementation class address through this method: The client is really used for the requested address recall our demo:sayhelloimplservice factory = new Sayhelloimplservice (); Sayhelloimpl Sayhelloimpl = Factory.getsayhelloimplport (); --><wsdl:service name= "Sayhelloimplservice" ><wsdl:port binding= "tns:sayhelloimplservicesoapbinding" Name= "Sayhelloimplport" ><soap:address location= "Http://132.122.239.74:8089/ws/sayhello"/></WSDL: Port></wsdl:service>

Above the WebService basic article in the SayHello as an example, the detailed analysis of the WSDL, and finally combined with the above analysis in a graphical representation of the image, I hope that the need for in-depth understanding of the WSDL document friends have some help.


Graphical WSDL

Depending on the parts of the WSDL document and the reference relationships between the sections, the following is shown in the legend:

Description: The arrow in indicates a reference relationship.


Talk about WebService Development-Application Chapter (iii)-teach you how to look at WSDL documents

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.