Web Services Platform Architecture [Electronic resources] : SOAP, WSDL, WS-Policy, WS-Addressing, WS-BPEL, WS-Reliable Messaging, and More نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Web Services Platform Architecture [Electronic resources] : SOAP, WSDL, WS-Policy, WS-Addressing, WS-BPEL, WS-Reliable Messaging, and More - نسخه متنی

Steve Mills

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید







10.6. Examples


The subsequent examples demonstrate a typical message exchange using the WS-Reliable Messaging protocol. What follows is the initial message to create the Sequence using a CreateSequence message.


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsa:MessageID>
http://example.com.com/0baaf88d-483b-4ecf-a6d8-a7c2eb546817
</wsa:MessageID>
<wsa:To>http://example.com.com/service/B</wsa:To>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence
</wsa:Action>
<wsa:ReplyTo>
<wsa:Address>http://example.com.com/service/A</wsa:Address>
</wsa:ReplyTo>
</soap:Header>
<soap:Body>
<wsrm:CreateSequence>
<wsrm:AcksTo>
<wsa:Address>
http://example.com.com/service/A
</wsa:Address>
</wsrm:AcksTo>
</wsrm:CreateSequence>
</soap:Body>
</soap:Envelope>

Next is a CreateSequenceResponse message.


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsa:MessageID>
http://example.com.com/guid/0baaf88d-483b-4ecf-a6d8-a7c2eb546818
</wsa:MessageID>
<wsa:To>http://example.com.com/service/A</wsa:To>
<wsa:RelatesTo>
http://example.com.com/guid/0baaf88d-483b-4ecf-a6d8a7c2eb546817
</wsa:RelatesTo>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequenceResponse
</wsa:Action>
</soap:Header>
<soap:Body>
<wsrm:CreateSequenceResponse>
<wsrm:Identifier>
http://example.com.com/RM/ABC
</wsrm:Identifier>
</wsrm:CreateSequenceResponse>
</soap:Body>
</soap:Envelope>

After WS-Reliable Messaging creates the Sequence, messages can begin flowing for the Sequence. In the next example, the Sequence has three messages, and one of the messages is lost in transit, requiring a retransmission.

Message 1


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsa:MessageID>
http://example.com.com/guid/71e0654e-5ce8-477b-bb9d-34f05cfcbc9e
</wsa:MessageID>
<wsa:To>http://example.com.com/service/B</wsa:To>
<wsa:From>
<wsa:Address>
http://example.com.com/service/A
</wsa:Address>
</wsa:From>
<wsa:Action>
http://example.com.com/service/B/request
</wsa:Action>
<wsrm:Sequence>
<wsrm:Identifier>
http://example.com.com/RM/ABC
</wsrm:Identifier>
<wsrm:MessageNumber>1</wsrm:MessageNumber>
</wsrm:Sequence>
</soap:Header>
<soap:Body>
<! Some Application Data >
</soap:Body>
</soap:Envelope>

Message 2


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsa:MessageID>
http://example.com.com/guid/daa7d0b2-c8e0-476e-a9a4-d164154e38de
</wsa:MessageID>
<wsa:To>http://example.com.com/service/B</wsa:To>
<wsa:From>
<wsa:Address>
http://example.com.com/service/A
</wsa:Address>
</wsa:From>
<wsa:Action>
http://example.com.com/service/B/request
</wsa:Action>
<wsrm:Sequence>
<wsrm:Identifier>
http://example.com.com/RM/ABC
</wsrm:Identifier>
<wsrm:MessageNumber>2</wsrm:MessageNumber>
</wsrm:Sequence>
</soap:Header>
<soap:Body>
<! Some Application Data >
</soap:Body>
</soap:Envelope>

Message 3


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsa:MessageID>
http://example.com.com/guid/0baaf88d-483b-4ecf-a6d8-a7c2eb546817
</wsa:MessageID>
<wsa:To>http://example.com.com/service/B</wsa:To>
<wsa:From>
<wsa:Address>
http://example.com.com/service/A
</wsa:Address>
</wsa:From>
<wsa:Action>
http://example.com.com/service/B/request
</wsa:Action>
<wsrm:Sequence>
<wsrm:Identifier>
http://example.com.com/RM/ABC
</wsrm:Identifier>
<wsrm:MessageNumber>3</wsrm:MessageNumber>
<wsrm:LastMessage/>
</wsrm:Sequence>
</soap:Header>
<soap:Body>
<! Some Application Data >
</soap:Body>
</soap:Envelope>

The RM Destination has not received message 2 because of a transmission error, so it responds with a SequenceAcknowledgement for messages 1 and 3.


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsa:MessageID>
http://example.com.com/guid/0baaf88d-483b-4ecf-a6d8-a7c2eb546817
</wsa:MessageID>
<wsa:To>http://example.com.com/service/A</wsa:To>
<wsa:From>
<wsa:Address>http://example.com.com/service/B</wsa:Address>
</wsa:From>
<wsa:Address>http://example.com.com/service/B</wsa:Address>
</wsa:From>
<wsa:RelatesTo>
http://example.com.com/guid/0baaf88d-483b-4ecf-a6d8-a7c2eb546817
</wsa:RelatesTo>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement
</wsa:Action>
<wsrm:SequenceAcknowledgement>
<wsrm:Identifier>
http://example.com.com/RM/ABC
</wsrm:Identifier>
<wsrm:AcknowledgementRange Upper="1" Lower="1"/>
<wsrm:AcknowledgementRange Upper="3" Lower="3"/>
</wsrm:SequenceAcknowledgement>
</soap:Header>
<soap:Body/>
</soap:Envelope>

The sending endpoint discovers that the RM Destination did not receive message 2, so it resends the message and requests an acknowledgement.


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsa:MessageID>
http://example.com.com/guid/0baaf88d-483b-4ecf-a6d8-a7c2eb546817
</wsa:MessageID>
<wsa:To>http://example.com.com/service/B</wsa:To>
<wsa:From>
<wsa:Address>http://example.com.com/service/A</wsa:Address>
</wsa:From>
<wsrm:Sequence>
<wsrm:Identifier>
http://example.com.com/RM/ABC
</wsrm:Identifier>
<wsrm:MessageNumber>2</wsrm:MessageNumber>
</wsrm:Sequence>
<wsrm:AckRequested>
<wsrm:Identifier>
http://example.com.com/RM/ABC
</wsrm:Identifier>
</wsrm:AckRequested>
</soap:Header>
<soap:Body>
<!-- Some Application Data -->
</soap:Body>
</soap:Envelope>

The RM Destination responds with a SequenceAcknowledgement for the complete sequence, which can then be terminated.


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsa:MessageID>
http://example.com.com/guid/0baaf88d-483b-4ecf-a6d8-a7c2eb546817
</wsa:MessageID>
<wsa:To>http://example.com.com/service/A</wsa:To>
<wsa:From>
<wsa:Address>http://example.com.com/service/B</wsa:Address>
</wsa:From>
<wsa:RelatesTo>
http://example.com.com/guid/0baaf88d-483b-4ecf-a6d8-a7c2eb546817
</wsa:RelatesTo>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement
</wsa:Action>
<wsrm:SequenceAcknowledgement>
<wsrm:Identifier>
http://example.com.com/RM/ABC
</wsrm:Identifier>
<wsrm:AcknowledgementRange Upper="3" Lower="1"/>
</wsrm:SequenceAcknowledgement>
</soap:Header>
<soap:Body/>
</soap:Envelope>

The RM Source receives the final SequenceAcknowledgement message. Then it sends a TerminateSequence to the RM Destination to indicate that it can reclaim the resources that are associated with the Sequence.


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsa:MessageID>
http://example.com.com/guid/0baaf88d-483b-4ecf-a6d8-a7c2eb546817
</wsa:MessageID>
<wsa:To>http://example.com.com/service/B</wsa:To>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence
</wsa:Action>
<wsa:From>
<wsa:Address>http://example.com.com/service/A</wsa:Address>
</wsa:From>
</soap:Header>
<soap:Body>
<wsrm:TerminateSequence>
<wsrm:Identifier>
http://example.com.com/RM/ABC
</wsrm:Identifier>
</wsrm:TerminateSequence>
</soap:Body>
</soap:Envelope>


    / 149