Home > Backend Development > XML/RSS Tutorial > Description of XML Schema-WSD

Description of XML Schema-WSD

黄舟
Release: 2017-03-14 16:17:34
Original
2143 people have browsed it

Web Services Description Language (Web Services Description Language, WSDL) provides a simple way to describe Web services (mostly using SOAP). WSDL allows you to describe services and interfaces provided using the SOAP standard. For example, you can create a WSDL file that describes the services provided on a certain server, and then distribute the file to servers that need these services. Web Services Description Language (WSDL) provides a way to describe Web services. Simple method (mostly using SOAP). WSDL allows you to describe services and interfaces provided by the SOAP standard.
For example, you can create a WSDL file that describes the services provided on a certain server, and then distribute the file to Web service consumers who need these services. By reading and parsing the WSDL file, consumers learn everything they need to know to use these Web services, including the
data types that can be exchanged, the parameters, and the various errors and other information returned. Using the example from
W3C again, you can see that the declaration of the different remote functions and the data exchanged are all handled through the XML definition of the structure, As shown in Listing 3.
Listing 3. XML definitions of different remote functions and exchanged data
         

 <?xml version="1.0"?>



<!-- root element wsdl:definitions defines set of related services -->

<wsdl:definitions name="EndorsementSearch"

  targetNamespace="http://namespaces.snowboard-info.com"

  xmlns:es="http://www.snowboard-info.com/EndorsementSearch.wsdl"

  xmlns:esxsd="http://schemas.snowboard-info.com/EndorsementSearch.xsd"

  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">



  <!-- wsdl:types encapsulates schema definitions of communication types; 

                                                       here using xsd -->

  <wsdl:types>



    <!-- all type declarations are in a chunk of xsd -->

    <xsd:schema targetNamespace="http://namespaces.snowboard-info.com"

      xmlns:xsd="http://www.w3.org/1999/XMLSchema">



      <!-- xsd definition: GetEndorsingBoarder [manufacturer string, 

                                                        model string] -->

      <xsd:element name="GetEndorsingBoarder">

  <xsd:complexType>

    <xsd:sequence>

      <xsd:element name="manufacturer" type="string"/>

            <xsd:element name="model" type="string"/>

    </xsd:sequence>

  </xsd:complexType>

      </xsd:element>



      <!-- xsd definition: GetEndorsingBoarderResponse 

[... endorsingBoarder string ...] -->

      <xsd:element name="GetEndorsingBoarderResponse">

  <xsd:complexType>

    <xsd:all>

      <xsd:element name="endorsingBoarder" type="string"/>

    </xsd:all>

  </xsd:complexType>

      </xsd:element>



      <!-- xsd definition: GetEndorsingBoarderFault 

[... errorMessage string ...] -->

      <xsd:element name="GetEndorsingBoarderFault">

  <xsd:complexType>

    <xsd:all>

      <xsd:element name="errorMessage" type="string"/>

    </xsd:all>

  </xsd:complexType>

      </xsd:element>



    </xsd:schema>

  </wsdl:types>



  <!-- wsdl:message elements describe potential transactions -->



  <!-- request GetEndorsingBoarderRequest is of type GetEndorsingBoarder -->

  <wsdl:message name="GetEndorsingBoarderRequest">

    <wsdl:part name="body" element="esxsd:GetEndorsingBoarder"/>

  </wsdl:message>



  <!-- response GetEndorsingBoarderResponse is of type 

                                       GetEndorsingBoarderResponse -->

  <wsdl:message name="GetEndorsingBoarderResponse">

    <wsdl:part name="body" element="esxsd:GetEndorsingBoarderResponse"/>

  </wsdl:message>



  <!-- wsdl:portType describes messages in an operation -->

  <wsdl:portType name="GetEndorsingBoarderPortType">



    <!-- the value of wsdl:operation eludes me -->

    <wsdl:operation name="GetEndorsingBoarder">

      <wsdl:input message="es:GetEndorsingBoarderRequest"/>

      <wsdl:output message="es:GetEndorsingBoarderResponse"/>

      <wsdl:fault message="es:GetEndorsingBoarderFault"/>

    </wsdl:operation>

  </wsdl:portType>



  <!-- wsdl:binding states a serialization protocol for this service -->

  <wsdl:binding name="EndorsementSearchSoapBinding"

                type="es:GetEndorsingBoarderPortType">



    <!-- leverage off soap:binding document style ...(no wsdl:foo pointing at 

the soap binding) -->

    <soap:binding style="document"

                  transport="http://schemas.xmlsoap.org/soap/http"/>



    <!-- semi-opaque container of network transport details classed by 

soap:binding above ... -->

    <wsdl:operation name="GetEndorsingBoarder">



      <!-- again bind to SOAP? ... -->

      <soap:operation soapAction="http://www.snowboard-info.com/

EndorsementSearch"/>



      <!-- further specify that the messages in the wsdl:operation 

"GetEndorsingBoarder" use SOAP? ... -->

      <wsdl:input>

        <soap:body use="literal"

       namespace="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/>

      </wsdl:input>

      <wsdl:output>

        <soap:body use="literal"

       namespace="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/>

      </wsdl:output>

      <wsdl:fault>

        <soap:body use="literal"

       namespace="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/>

      </wsdl:fault>

    </wsdl:operation>

  </wsdl:binding>



  <!-- wsdl:service names a new service "EndorsementSearchService" -->

  <wsdl:service name="EndorsementSearchService">

    <wsdl:documentation>snowboarding-info.com Endorsement Service</

wsdl:documentation> 



    <!-- connect it to the binding "EndorsementSearchSoapBinding" above -->

    <wsdl:port name="GetEndorsingBoarderPort"

               binding="es:EndorsementSearchSoapBinding">



      <!-- give the binding an network address -->

      <soap:address location="http://www.snowboard-info.com/EndorsementSearch"/>

    </wsdl:port>

  </wsdl:service>



 </wsdl:definitions>
Copy after login

WSDL declares the message type, default data type and content, and exchanged data structure .

Everything you need to access the SOAP structure on the server can be found in this WSDL. Most languages ​​and environments provide a mechanism for reading and parsing WSDL to determine available functions and data exchanges.
WSDL not only defines the SOAP interface for exchanging information, but with the appropriate WSDL generator, can also be used to create the code needed to send requests and generate and format responses.
WSDL and SOAP form a powerful remote procedure call system.                                                                                              

The above is the detailed content of Description of XML Schema-WSD. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template