Title: WS-Routing
1WS-Routing
2Why WS-Routing?
- SOAP (by itself) doesnt define a message path
- Header blocks describe functions to be performed
by intermediaries that play specified roles, but
there is no standard way to provide addresses of
intermediaries or indicate the order in which
intermediaries are to be visited - Envelope doesnt contain address (target module,
target node) - Hence, SOAP message is embedded in another
application layer protocol - generally HTTP -
that contains the address - receiving (HTTP) processor directs message to
target (application) module - Target module determines next node and addresses
the HTTP message to it
3Why WS-Routing?
- WS-Routing extends SOAP with an addressing
structure to define a complete message path - Extended SOAP message is self-contained
- does not have to be bound to another application
layer protocol - can be sent directly over a transport protocol
(e.g., TCP) - receiving SOAP processor directs message to
target module - target module interprets WS-Routing information
and sends message to next intermediary using
transport protocol
4WS-Routing
- WS-Routing
- is stateless nodes along path do not maintain
state - defines a SOAP header for storing routing
information - supports
- Specification of a forward path
- Specification of a reverse path
- Specification of relationships (correlation)
between messages
5Intermediaries
- Support a distributed processing mechanism in
which nodes along a message path supply
value-added services - SOAP header contains the part of a message to be
processed by an intermediary that fulfills a
particular role
6Specifying the Message Path
- ltpathgt - WS-Routing (SOAP) header block
- ltfromgt - URI of initial sender
- lttogt - URI of final destination
- ltfwdgt - specifies forward message path using an
ordered list of ltviagt elements - ltviagt - URI of an intermediate
- ltrevgt - (optional) specifies reverse message path
using an ordered list of ltviagt elements
7WS-Routing Processing
- Final destination is the lttogt (if present) or the
last ltviagt child of ltfwdgt element - On receipt of message, a node deletes the first
ltviagt child of ltfwdgt, processes appropriate
header blocks, and relays message to new first
ltviagt child of ltfwdgt, or to lttogt element if ltfwdgt
has no children - A node may insert new ltviagt children to
dynamically build the forward path
8Message Format
ltsEnvelope xmlnss ltsHeadergt
ltmpath xmlnsm WS-Routing namespace gt
ltmactiongt URI identifying processor at
destinationlt/mactiongt ltmtogt URI
identifying final destination lt/mtogt
ltmfwdgt ltmviagt URI
identifying first intermediary lt/mviagt
ltmviagt URI identifying second
intermediary lt/mviagt
additional intermediaries can be specified here
lt/mfwdgt ltmfromgt
URI identifying initial sender lt/mfromgt
ltmidgt unique message identifier
lt/midgt lt/mpathgt other
headers lt/sHeadergt ltsBodygt .
lt/sBodygt lt/sEnvelopegt
9Reverse Path
- In some applications it may be appropriate to
provide for a response message - Communication follows request/response pattern
- Peer-to-peer communication is anticipated
- A fault message may be generated
- An acknowledgement will be sent
- Problem Dont want intermediate nodes to have to
maintain state to remember the reverse path
10Reverse Path
- Solution Sender includes a ltrevgt child of ltpathgt
element in forward message - Reverse path is built dynamically and stored in
message as it progresses in forward direction - Indicates a possible path to be used by receiver
for a return message - Intermediary may short-circuit forward path and
reply to initial sender over the (partial)
reverse path - Appropriate if intermediary implements a cache
11Building the Reverse Path
- When an intermediary receives a message
containing a ltrevgt element it adds a new ltviagt
element as the head of the ltrevgt list containing
its own URI.
12Constructing the Reverse Path
ltmpath gt . ltmfwdgt
ltmviagtCs URIlt/mviagt lt/mfwdgt
ltmrevgt ltmviagt Bs URIlt/mviagt
ltmviagt As URIlt/mviagt lt/mrevgt
. lt/mpathgt
ltmpath gt . ltmfwdgt
ltmviagtBs URIlt/mviagt ltmviagtCs
URIlt/mviagt lt/mfwdgt ltmrevgt
ltmviagtAs URIlt/mviagt lt/mrevgt
. lt/mpathgt
message arriving at B from A
message leaving B addressed to C
13Message Correlation
- ltmrelatesTogt can be used to store the value of
the ltmidgt field of a related message - A reply message is related to a forward message
- A fault message is related to the message that
caused the fault