Skip to main content
In API Proxies of type SOAP or REST-SOAP-REST, if the “Fix SOAP Action value” option is selected in the routing tab on the message coming to Apinizer, some changes can be made according to the following conditions. In order for these changes to be made, the SOAP version of the incoming message is first determined. To decide on the SOAP version, the Content-Type value sent in the Request Header and the namespace value of the SOAP XML in the Request Body are checked.
If these two values differ, priority is given to the Content-Type header. If the Content-Type value is empty or meaningless, the SOAP version is determined from the namespace value of the SOAP XML.

SOAP Version Determination

The methods for determining SOAP version are detailed below:
If the SOAP version value is determined by Content-Type, the following rules apply:
  • If it starts with text/xml value, it is SOAP 1.1
  • If it starts with application/soap+xml value, it is SOAP 1.2
  • If it starts with application/xop+xml value and the type value in the Content-Type value contains text/xml, it is SOAP 1.1
  • If it starts with application/xop+xml value and the type value in the Content-Type value contains application/soap+xml, it is SOAP 1.2
Examples:
Content-Type: text/xml; charset=UTF-8
→ SOAP 1.1
Content-Type: application/soap+xml; charset=UTF-8
→ SOAP 1.2
Content-Type: application/xop+xml; type="text/xml"
→ SOAP 1.1
Content-Type: application/xop+xml; type="application/soap+xml"
→ SOAP 1.2
If the SOAP version value is determined by the namespace value of the SOAP XML, the following rules apply:
  • If the namespace value is http://schemas.xmlsoap.org/soap/envelope/, it is SOAP 1.1
  • If the namespace value is http://www.w3.org/2003/05/soap-envelope, it is SOAP 1.2
Example SOAP 1.1 Message:
<soap:Envelope 
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <!-- Message content -->
  </soap:Body>
</soap:Envelope>
Example SOAP 1.2 Message:
<soap:Envelope 
  xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Body>
    <!-- Message content -->
  </soap:Body>
</soap:Envelope>

Operations According to SOAP Version

When the SOAP version value is determined, the following operations are performed:
  1. The namespace value of the SOAP XML is corrected according to the SOAP version.
  2. According to the SOAP version, the following operations are performed:
For requests with SOAP version 1.1:
  1. If the soapaction keyword exists in the request header, the spelling is corrected, otherwise a header is added in the form of SOAPAction.
  2. The value to be added to the SOAPAction keyword is the SOAPAction value belonging to the method from which the message came and obtained by parsing from the WSDL definition.
  3. If there are no quotation marks at the beginning and end of the SOAPAction value, quotation marks are added.
  4. The Content-Type value is set to text/xml.
  5. If there is a Character Encoding value, it is added to the Content-Type value, otherwise ;charset=UTF-8 value is added by default.
Example SOAP 1.1 Request:
POST /service HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://example.com/GetUser"

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <!-- Request content -->
  </soap:Body>
</soap:Envelope>
For requests with SOAP version 1.2:
  1. The Content-Type value is set to application/soap+xml.
  2. If there is a Character Encoding value, it is added to the Content-Type value, otherwise ;charset=UTF-8 value is added by default.
  3. The expression ;action=<SOAPAction> is added to the Content-Type value.
Example SOAP 1.2 Request:
POST /service HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="http://example.com/GetUser"

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
  <soap:Body>
    <!-- Request content -->
  </soap:Body>
</soap:Envelope>
In SOAP 1.2, the action parameter in Content-Type is used instead of the SOAPAction header. This is an important difference from SOAP 1.1.