doedje / jquery.soap

This script uses $.ajax to send a SOAP:Envelope. It can take XML DOM, XML string or JSON as input and the response can be returned as either XML DOM, XML string or JSON too.
352 stars 148 forks source link

Soap 1.2 action not sent #102

Closed gormed closed 7 years ago

gormed commented 8 years ago

For soap 1.2 requests, the content-type needs to include the action (see http://webservices.xml.com/pub/a/ws/2003/06/10/salz.html)

A SOAP 1.2 message would have the following: Content-Type: application/soap+_xml; action=http://example.com/ticker

So i had to add it to get my requests working like this (line 282):

contentType: contentType + "; charset=UTF-8" + (options.soap12 ? "; action=" + options.action : ""),

doedje commented 8 years ago

Looks like a fine solution, care to send me pull request?

doedje commented 7 years ago

I will include the code myself.... but just to be clear on the subject, the action is optional, implementations receiving soap1.2 should not require its presents...

A.3 The action parameter

This optional parameter can be used to specify the URI that identifies the intent of the message. In SOAP 1.2, it serves a similar purpose as the SOAPAction HTTP header field did in SOAP 1.1. Namely, its value identifies the intent of the message.

The value of the action parameter is an absolute URI-reference as defined by [RFC 2396]. SOAP places no restrictions on the specificity of the URI or that it is resolvable.

Although the purpose of the action parameter is to indicate the intent of the SOAP message there is no mechanism for automatically computing the value based on the SOAP envelope. In other words, the value has to be determined out of band.

It is recommended that the same value be used to identify sets of message types that are logically connected in some manner, for example part of the same "service". It is STRONGLY RECOMMENDED that the URI be globally unique and stable over time.

The presence and content of the action parameter MAY be used by servers such as firewalls to appropriately filter SOAP messages and it may be used by servers to facilitate dispatching of SOAP messages to internal message handlers etc. It SHOULD NOT be used as an insecure form of access authorization.

Use of the action parameter is OPTIONAL. SOAP Receivers MAY use it as a hint to optimize processing, but SHOULD NOT require its presence in order to operate.

from the w3c soap1.2 specs

Thanx anywayz....