Листинг 2. Описание типов в XML-схеме для сервиса, предназначенного для передачи информации о котировках акций

http://example.com/stockquote/stockquoteV11.xsd

<?xml version="1.0"?>
<schema targetNamespace="http://example.com/stockquote/schemas"
       
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>

http://example.com/stockquote/stockquoteV20.xsd

<?xml version="1.0"?>
<schema targetNamespace="http://example.com/stockquote/schemas"
       
xmlns="http://www.w3.org/2001/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>


Листинг 3. Описание интерфейса сервиса для сервиса, предназначенного для передачи информации о котировках акций, на WSDL 1.1

http://example.com/stockquote/stockquoteV11.wsdl

<?xml version="1.0"?>
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote/definitions"
          
xmlns:tns="http://example.com/stockquote/definitions"
          
xmlns:xsd1="http://example.com/stockquote/schemas"
          
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          
xmlns="http://schemas.xmlsoap.org/wsdl/">
   
<import namespace="http://example.com/stockquote/schemas"
           
location="http://example.com/stockquote/stockquoteV11.xsd"/>
    
<message name="GetLastTradePriceInput">
        
<part name="body" element="xsd1:TradePriceRequest"/>
    </message>
    
<message name="GetLastTradePriceOutput">
        
<part name="body" element="xsd1:TradePrice"/>
    </message>
    
<portType name="StockQuotePortType">
        
<operation name="GetLastTradePrice">
           
<input message="tns:GetLastTradePriceInput"/>
           
<output message="tns:GetLastTradePriceOutput"/>
        </operation>
    </portType>
</definitions>


Листинг 4. Описание интерфейса сервиса для сервиса, предназначенного для передачи информации о котировках акций, на WSDL 2.0

http://example.com/stockquote/stockquoteV20.wsdl

<?xml version="1.0"?>
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote/definitions"
          
xmlns:tns="http://example.com/stockquote/definitions"
          
xmlns:xsd1="http://example.com/stockquote/schemas"
          
xmlns:soap="http://www.w3.org/2003/11/wsdl/soap12"
          
xmlns="http://www.w3.org/2003/11/wsdl">
   
<import namespace="http://example.com/stockquote/schemas"
           
location="http://example.com/stockquote/stockquoteV20.xsd"/>
   
<types>
                
<schema targetNamespace="http://example.com/stockquote/definitions">
                                
<element name="GetLastTradePriceInput" type="xsd1:TradePriceRequest"/>
                                
<element name="GetLastTradePriceOutput" type="xsd1:TradePrice"/>
                </schema>
   </types>
    
<interface name="StockQuoteInterface">
        
<operation name="GetLastTradePrice" pattern="http://www.w3.org/2003/11/wsdl/in-out">
           
<input message="tns:GetLastTradePriceInput"/>
           
<output message="tns:GetLastTradePriceOutput"/>
        </operation>
    </interface>
</definitions>


Листинг 5. Описание реализации сервиса для сервиса, предназначенного для передачи информации о котировках акций, на WSDL 1.1

http://example.com/stockquote/stockquoteserviceV11.wsdl

<?xml version="1.0"?>
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote/service"
          
xmlns:tns="http://example.com/stockquote/service"
          
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          
xmlns:defs="http://example.com/stockquote/definitions"
          
xmlns="http://schemas.xmlsoap.org/wsdl/">
   
<import namespace="http://example.com/stockquote/definitions"
           
location="http://example.com/stockquote/stockquoteV11.wsdl"/>
    
<binding name="StockQuoteSoapBinding" type="defs: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>
    <service name="StockQuoteService">
        
<documentation>My first service</documentation>
        
<port name="StockQuotePort" binding="tns:StockQuoteBinding">
           
<soap:address location="http://example.com/stockquote"/>
        </port>
    </service>
</definitions>


Листинг 6. Описание реализации сервиса для сервиса, предназначенного для передачи информации о котировках акций, на WSDL 2.0

http://example.com/stockquote/stockquoteserviceV20.wsdl

<?xml version="1.0"?>
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote/service"
          
xmlns:tns="http://example.com/stockquote/service"
          
xmlns:wsoap="http://www.w3.org/2003/11/wsdl/soap12"
          
xmlns:defs="http://example.com/stockquote/definitions"
          
xmlns="http://www.w3.org/2003/11/wsdl">
   
<import namespace="http://example.com/stockquote/definitions"
           
location="http://example.com/stockquote/stockquoteV12.wsdl"/>
    
<binding name="StockQuoteSoapBinding" interface="defs:StockQuoteInterface">
        
<wsoap:binding protocol="http://www.w3.org/2003/11/wsdl/http"/>
        
<operation name="GetLastTradePrice">
           
<wsoap:operation soapAction="http://example.com/GetLastTradePrice"/>
           <input>
               <wsoap:body/>
           </input>
           <output>
               <wsoap:body/>
           </output>
        </operation>
    </binding>
    <service name="StockQuoteService">
        
<documentation>My stock quote service</documentation>
        
<endpoint name="StockQuoteEndPoint" binding="tns:StockQuoteSoapBinding">
           
<wsoap:address location="http://example.com/stockquote"/>
        </endpoint>
    </service>
</definitions>