WSE Support for Reliable Messaging

In version 2.0, WSE supports the WS-Addressing specification, but WS-ReliableMessaging is not yet supported. WSE support for WS-Addressing consists of a set of input and output message filters that read and write the SOAP headers defined in WS-Addressing. WSE automatically adds the appropriate addressing headers to all outgoing SOAP messages. In addition, WSE provides a full API for programmatically creating and accessing addressing objects, and you can explicitly define the addressing objects for outgoing messages to override the values that are automatically generated by WSE.

Creating Custom Address Headers

One of the things that you can do with WSE is to explicitly define the ReplyTo and FaultTo headers in an outbound message. This lets you redirect this type of response message to a different endpoint than the one from which the request was originally sent. When using the WSE, this can be accomplished programmatically by instantiating both a ReplyTo and a FaultTo object in the Microsoft.Web.Services.Addressing namespace, defining appropriate address URI values for each, and adding them to the SoapContext for the outgoing message, as in the following example:

 // Create a new SoapContext for the request message 
SoapContext myContext = myService.RequestSoapContext;

// Define a different reply address for the request
ReplyTo replyAddress = new ReplyTo(new

// Define a reply address for fault messages
FaultTo faultAddress = new FaultTo(new

// Add the custom ReplyTo and FaultTo addressing headers to the SoapContext
myContext.Addressing.ReplyTo = replyAddress;
myContext.Addressing.FaultTo = faultAddress;

// Security headers added here

// Call the GetDocument method

Based on this code, WSE generates the following SOAP request message:

 <soap:Envelope xmlns:soap="" 
<wsa:From wsu:Id="Id-4851c756-f3a6-43be-9d71-e7d8368eb897">
<wsa:ReplyTo wsu:Id="Id-758cb1e1-813b-4ed0-9682-91cd083fd3b1">

<soap:Body wsu:Id="Id-b079ec45-be0b-400e-a6a3-f0af290e70d8">
<GetDocument xmlns="">


In the same way, the values of address headers in an incoming message can be accessed by reading the relevant property from the AddressingHeaders object, which is accessed from the SoapContext.Addressing property of the incoming message.

Understanding Web Services Specifications and the WSE
Understanding Web Services Specifications and the WSE (Pro Developer)
ISBN: 0735619131
EAN: 2147483647
Year: 2006
Pages: 79

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: