C# – WCF Soap Actions in HTTP header or SOAP header

csoapwcf

I'm a little confused about how SOAPAction is implemented in WCF (and other web service frameworks for that matter).

In a test client, I have a Client Message Inspector configured to grab both the SOAP message and any HTTP headers that are being sent with the request. At least here in the client message inspector, the action shows up as an element in the SOAP Header:

<s:Header>
    <Action ... >http://myurl.com/2009/11/MyService/MyMethod</Action>

However, if I view the request in Fiddler, the Action element is missing and instead there is now an additional entry in the HTTP Headers:

SOAPAction: "http://myurl.com/2009/11/MyService/MyMethod"

Can anyone explain what the heck is going on??

Thanks!

Best Answer

This is a problem with WCF not following the standards.

SOAP 1.1 uses the SOAPAction header to decide what method to call, but this was a bit messy as the method name was embedded elsewhere in the message. SOAP 1.2 resolved this and added the action to content-type header, and deprecated the SOAPAction header (though its now an optional for those clients that still want to send it).

See an o'reilly blog page for some details.