Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Soap Actions in HTTP header or SOAP header?

Tags:

c#

soap

wcf

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!

like image 608
WayneC Avatar asked Jan 26 '10 20:01

WayneC


People also ask

What is the difference between SOAP header and HTTP header?

HTTP headers usually stop at the web server while the SOAP message in it's entirety will be passed downstream to the ultimate receiver who needs the data (maybe even passing through more intermediaries who they might also need it).

What is SOAP Action header?

The SOAPAction header is a transport protocol header (either HTTP or JMS). It is transmitted with SOAP messages, and provides information about the intention of the web service request, to the service. The WSDL interface for a web service defines the SOAPAction header value used for each operation.

What goes in a SOAP header?

The SOAP <Header> is an optional element in a SOAP message. It is used to pass application-related information that is to be processed by SOAP nodes along the message path. The immediate child elements of the <Header> element are called header blocks.

How do I add a SOAP header to a SOAP request?

Select the service task or web service integration component and click the Variables tab above the diagram area. Create the private variable that you will later map to the SOAP header of the request message. To add a single header entry to the request message, use the variable type SOAPHeader.


1 Answers

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.

like image 102
gbjbaanb Avatar answered Oct 23 '22 10:10

gbjbaanb