views:

220

answers:

1

I'm building a Web Service in C# with VS2008, and want to implement WS-Addressing, so the message headers look like eg below:

What do I need to add / do in VS2008 to make this happen?

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
 xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
 xmlns:wsa="http://www.w3.org/2005/08/addressing"
 xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsssecurity-secext-1.0.xsd"
 xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
 xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"&gt;
 <soap:Header>
  <wsa:To>http://messagehandler.org.com/sendmessage&lt;/wsa:To&gt;
  <wsa:ReferenceParameters>
  </wsa:ReferenceParameters>
  <wsa:From>
   <wsa:EndpointReference>
    <wsa:Address>http://www.thirdparty.com/address&lt;/wsa:Address&gt;
   </wsa:EndpointReference>
  </wsa:From>
  <wsa:Action>http://www.org.com/ServiceName&lt;/wsa:Action&gt;
  <wsa:MessageID>urn:uuid:18367C02-8286-487b-9D35-D2EDC974ACF8</wsa:MessageID>
  <wsa:RelatesTo>urn:uuid:346CC216-5C14-496d-B6EA-7B644CAF6D48</wsa:RelatesTo>
  <wsse:Security>
  </wsse:Security>
 </soap:Header>
A: 

The best way to get started with all the WS-* standards in .NET is by using WCF. It has a wsHttpBinding which implements a truckload of those WS-* standards.

As for resoures: there's the MSDN WCF Developer Center which has everything from beginner's tutorials to articles and sample code.

Also read the MSDN article WCF Messaging Fundamentals, and specifically for WS-Addressing, see the blog post Fancy Addressing in WCF.

Also, I would recommend you have a look at the Pluralsight screen casts on WCF - it's an excellent series going from "Creating your first WCF service" and "Creating your first WCF client" all the way to rather advanced topics. Aaron Skonnard very nicely explains everything in 10-15 minutes screencasts - highly recommended!

marc_s