Section 5.3. Example


5.3. Example

As an example of the concepts just presented, assume that a service requester intends to invoke the "GetStockQuote" operation on the following endpoint reference:

 <wsa:EndpointReference xmlns:exp="..." xmlns:tns="..." xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">    <wsa:Address>http://www.example.com/stq</wsa:Address>    <wsa:ReferenceProperties>        <exp:customer-id>xgtopsnlk-0001<exp:customer-id>    </wsa:ReferenceProperties>    <wsa:ReferenceParameters>        <exp:model-id>llp-11<exp:model-id>    </wsa:ReferenceParameters>    <wsa:PortType>tns:StockQuotePortType</wsa:PortType>    <wsa:ServiceName PortName="StockQuotePort">         tns:StockQuoteService    </wsa:ServiceName> </wsa:EndpointReference> 

Using the information on the endpoint reference (Address, Reference Properties, and Reference Parameters) and the Action values encoded in the operation definition (as in the preceding example), a SOAP request message would be as follows (assuming that the port "StockQuotePort" provides a standard SOAP binding):

 <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"   xmlns:exp="... ">   <S:Header>     <wsa:MessageID>uuid:aaaabbbb-cccc-dddd-eeee-ffffffffffff     </wsa:MessageID>     <wsa:ReplyTo>        <wsa:Address>         http://stq-services.com/requester        </wsa:Address>     </wsa:ReplyTo>     <wsa:To>http://www.example.com/stq</wsa:To>     <wsa:Action>http://example.com/GetQuote</wsa:Action>     <exp:model-id>llp-11<exp:model-id>     <exp:customer-id>xgtopsnlk-0001<exp:customer-id>   </S:Header>   <S:Body>    ... <!ticker symbol >   </S:Body> </S:Envelope> 

Observe how the reference properties and parameters are serialized as SOAP headers in the SOAP envelope. The response from the endpoint is formulated using the values of the ReplyTo and MessageId headers in addition to the Action for the output message provided by the WSDL definition of the operation. It would be as follows:

 <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"   xmlns:exp="... ">   <S:Header>     <wsa:RelatesTo> uuid:aaaabbbb-cccc-dddd-eeee-ffffffffffff     </wsa:RelatesTo>     <wsa:To>http://stq-services.com/requester</wsa:To>     <wsa:Action>http://example.com/Quote</wsa:Action>   </S:Header>   <S:Body>    ... <!quote >   </S:Body> </S:Envelope> 



    Web Services Platform Architecture(c) SOAP, WSDL, WS-Policy, WS-Addressing, WS-BP[.  .. ] More
    Web Services Platform Architecture(c) SOAP, WSDL, WS-Policy, WS-Addressing, WS-BP[. .. ] More
    ISBN: N/A
    EAN: N/A
    Year: 2005
    Pages: 176

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net