Blogger :
Musings from Gudge
All posts :
All posts by Musings from Gudge
Category :
WSCF/WCF
Blogged date : 2005 May 22
A fellow Indigette, Dan Roth, pointed out to me via e-mail and a comment on my
earlier blog entry, that I`d neglected to explain *why* the service level message logs contain SOAP headers that were not actually transmitted by the client. This entry attempts to make up for my earlier omission.
The binding I`ve used in my samples so far does not actually use
WS-Addressing on the wire. This means that the messages sent by the client don`t actually contain wsa:To or wsa:Action headers. However, it is possible to infer the values of those headers from the HTTP
Request-URI and the
SOAPAction HTTP header respectively. When a message arrives at the service the server-side plumbing for the binding creates the wsa:To and wsa:Action headers and populates the message object with them. This means that other parts of the plumbing (and the application code, if it cares) don`t need to worry about whether the message actually used WS-Addressing or not (at least WRT wsa:To and wsa:Action); the values can always be pulled out of the same place, namely the
Headers property of the
System.ServiceModel.Message object;
System.ServiceModel.Message.Headers.To
System.ServiceModel.Message.Headers.Action
OperationContext.Current.IncomingMessageHeaders.To
OperationContext.Current.IncomingMessageHeaders.Action
We could also use
OperationContext.Current.RequestContext.RequestMessage.Headers.To
OperationContext.Current.RequestContext.RequestMessage.Headers.Action