WSDL

Overview
*WSDL is an XML document
*WSDL is used to describe web services
*Extensible (detail?)

Construct
*Types: defines data types using XSD (schema).

<types>
  <schema targetNamespace="http://example.com/stockquote.xsd"
    xmlns="http://www.w3.org/2000/10/XMLSchema">
    <element name="TradePriceRequest">
      <complexType>
        <all>
          <element name="tickerSymbol" type="string"/>
        </all>
      </complexType>
    </element>
    <element name="TradePrice">
      <complexType>
        <all>
          <element name="price" type="float"/>
        </all>
      </complexType>
    </element>
  </schema>
</types>

*Message: an abstract, typed definition of data being communicated (parameter).

<message name="GetLastTradePriceInput">
  <part name="body" element="xsd1:TradePriceRequest"/>
</message>
 
<message name="GetLastTradePriceOutput">
  <part name="body" element="xsd1:TradePrice"/>
</message>

*Operation: an abstract description of an action (method).

<operation name="GetLastTradePrice">
  <input message="tns:GetLastTradePriceInput"/>
  <output message="tns:GetLastTradePriceOutput"/>
</operation>

*Port Type: an abstract collection of operations (class).

<portType name="StockQuotePortType">
  <operation name="GetLastTradePrice">
     <input message="tns:GetLastTradePriceInput"/>
     <output message="tns:GetLastTradePriceOutput"/>
  </operation>
</portType>

*Binding: communication protocol (protocol).

<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  <operation name="GetLastTradePrice">
     <soap:operation soapAction="http://example.com/GetLastTradePrice"/>
     <input>
         <soap:body use="literal"/>
     </input>
     <output>
         <soap:body use="literal"/>
     </output>
  </operation>
</binding>

*Port: a single endpoint, i.e. binding + network address.

<port name="StockQuotePort" binding="tns:StockQuoteBinding">
   <soap:address location="http://example.com/stockquote"/>
</port>

*Service: a collection of endpoints (ports).

<service name="StockQuoteService">
  <documentation>My first service</documentation>
  <port name="StockQuotePort" binding="tns:StockQuoteBinding">
    <soap:address location="http://example.com/stockquote"/>
  </port>
</service>
This entry was posted in ws stds. Bookmark the permalink.