For me it has alway been a headache to understand and remember the complexity behind soap action and web services addressing action. As I have again started working on WSFC/wsclient a wget like command line tool specifically designed for consuming web services, I thought of writing down the facts from the corresponding authentic sources clearly for the benefit of at least me for future reference.
In WS-I version 1.1 it states
The SOAPAction
header is purely a hint to processors. All vital information regarding the intent of a message is carried in the envelope.
– `A HTTP request MESSAGE MUST contain a SOAPAction
HTTP header field with a quoted value equal to the value of the soapAction
attribute of soapbind:operation
, if present in the corresponding WSDL description.`
– `A HTTP request MESSAGE MUST contain a SOAPAction
HTTP header field with a quoted empty string value, if in the corresponding WSDL description, the soapAction
of soapbind:operation
is either not present, or present with an empty string as its value.`
Again the `Web Services Addressing 1.0 – WSDL Binding` states clearly about the explicit association between wsa:action and SOAPAction as follows
`WS-Addressing defines a global attribute, wsaw:Action, that can be used to explicitly define the value of the [action] property for messages in a WSDL description. The type of the attribute is xs:anyURI and it is used as an extension on the WSDL input, output and fault elements. A SOAP binding can specify SOAPAction values for the input messages of operations. In the absence of a wsaw:Action attribute on a WSDL input element where a SOAPAction value is specified, the value of the [action] property for the input message is the value of the SOAPAction specified. Web Services Addressing 1.0 – SOAP Binding[WS-Addressing SOAP Binding] specifies restrictions on the relationship between the values of [action] and SOAPAction for SOAP 1.1 and SOAP 1.2.
The inclusion of wsaw:Action without inclusion of wsaw:UsingAddressing has no normative intent and is only informational. In other words, the inclusion of wsaw:Action attributes in WSDL alone does not imply a requirement on clients to use Message Addressing Properties in messages it sends to the service. A client, however, MAY include Message Addressing Properties in the messages it sends, either on its own initiative or as described by other elements of the service contract, regardless of the presence or absence of wsaw:UsingAddressing. Other specifications defining the value of [action] are under no constraint to be consistent with wsaw:Action.`
I do not like to interpret the above readings from the specifications with my own wording and confuse the reader or myself later. The best thing is to re-read the above and to refer if neccessary to the relevant sources to understand this clearly.
Hi,
I am making my first steps with axis2c, coming from a java world it is …different 🙂 Anyway, I wanted to know if your client (using axis2c) sends a Soap-action in the http header, since mine doesn’t seem to set it and I don’t understand why 😦 Thanks a lot and keep up the good work ! 🙂
Hi jvleminc,
You need to specifically set soap action in your Axis2/c client as follows to make it send soapAction http header.
axutil_string_t *soap_action = axutil_string_create(env,”axis2/c/samples/echoString”);
axis2_options_set_soap_action(options, env, soap_action);
By doing just
axis2_options_set_action(options, env, action);
add addressing action soap header. Note that if you call this function in your Axis2/C client application addressing will be automatically engaged even when you don’t specifically call
axis2_svc_client_engage_module(svc_client, env, AXIS2_MODULE_ADDRESSING);
To learn more about more about ws addressing read article
http://wso2.org/library/2605
Hi Damitha,
I’m trying to implement a service that implements ws addressing in the axis2c framework.
The service is mediated through a ESB flow(Message broker).
I send a asynchronous soap request and I get an ack back from the http server but no response.
There is not much information in the logs, the only information in log says
“Starting addressing out handler Starting addressing in handler Starting addressing out handler soap_builder.c(852) SOAP message does not have a SOAP envelope element ”
To enable ws addressing in axis 2c. I have made sure that the addressing module is enabled in the axis2.xml and the services.xml has the wsmapping which matches the ws:action attribute I send out.
Am I missing anything? Do I neeed to add any additonal metadata in the WSDL to enable ws addressing.
Any help is much appreciated.
Thanks
GV
I also noticed that this has logged as a issue, not sure if this has been resolved.
On a realted thread I noticed a code patch was done
http://www.mail-archive.com/axis-c-dev@ws.apache.org/msg15416.html
But the I see both the lines of code in the addressing module. Could this be the issue?