Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 36 ยท Getting Started

SOAP 1.1 vs 1.2 and Transports

Compare SOAP 1.1 and 1.2: namespaces, content types, SOAPAction, fault format and HTTP status codes, plus how SOAP rides on HTTP, SMTP and message queues.

There are two SOAP versions in daily use: SOAP 1.1 (2000) and SOAP 1.2 (2003, a W3C Recommendation). Both look similar, so they are easy to confuse, and mixing them is a classic cause of mysterious errors such as "Version mismatch" or "415 Unsupported Media Type". This lesson shows exactly where they differ and how a service can support both.

The differences at a glance

Topic SOAP 1.1 SOAP 1.2
Envelope namespace http://schemas.xmlsoap.org/soap/envelope/ http://www.w3.org/2003/05/soap-envelope
HTTP Content-Type text/xml application/soap+xml
Operation hint SOAPAction header (required) action parameter inside Content-Type (optional)
Fault children faultcode, faultstring, faultactor, detail Code, Reason, Node, Role, Detail
Fault code names Client, Server Sender, Receiver
HTTP status for faults 500 400 for Sender, 500 for Receiver
Header attribute actor role
Well-defined processing model informal precise, with mustUnderstand rules
Specification a W3C Note a W3C Recommendation

The namespace is the most important: it is the version. A service that receives an envelope in an unknown namespace must answer with a VersionMismatch fault.

Detecting the version

A tolerant service can look at the envelope namespace and choose how to answer. The program below does exactly that: it receives either flavor, replies in kind, and rejects anything else with VersionMismatch.

Node.js A service that speaks both versions

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Tools such as Postman and SoapUI choose the version from the WSDL binding or from a setting; if a call fails, check that the namespace, the Content-Type and the fault expectations all point to the same version.

SOAPAction explained

In SOAP 1.1 the HTTP header SOAPAction: "urn:calc/Add" accompanies every request. Its value comes from the WSDL (the soapAction attribute of the operation). Servers and gateways use it to route the message without parsing XML. Some services insist on it; some ignore it; some are picky about the quotes. In SOAP 1.2 the value moves into the content type:

TEXT
Content-Type: application/soap+xml; charset=utf-8; action="urn:calc/Add"

If a call returns "The SOAPAction header is required" or "No action found", this is the first place to look.

Transport neutrality

The SOAP envelope says nothing about how it travels. The mapping from SOAP onto a transport is called a binding. The standard one is HTTP, but others exist.

flowchart LR
    M["SOAP envelope"] --> H["HTTP / HTTPS"]
    M --> Q["JMS / MQ queues"]
    M --> E["SMTP e-mail"]
    M --> T["Raw TCP"]
    M --> W["WebSocket"]

The same envelope can be carried by different transports.

Transport When it fits
HTTP/HTTPS Request-response calls across the internet. The default.
JMS or IBM MQ Reliable, asynchronous delivery inside a company; messages wait in a queue.
SMTP Slow, one-way messages where the receiver is often offline. Rare.
TCP Fast private links, for example WCF's net.tcp binding.

Transport choice affects reliability: HTTP either delivers or fails now, while a queue keeps the message until the receiver is ready. That difference is why WS-ReliableMessaging exists.

One envelope, two carriers

To show that the envelope really is separate from the transport, this program writes the same SOAP message to a "file queue" in memory and sends it over HTTP, then reads both back identically.

Node.js Same message, two transports

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

When you design a new service, pick SOAP 1.2 unless a partner requires 1.1. When you consume an existing one, use whatever its WSDL binding says. Never guess: the binding names the version.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What decides the version of a SOAP message?

    The Envelope namespace identifies the version. An unknown namespace should be answered with a VersionMismatch fault.
  2. 2. Which Content-Type is used by SOAP 1.2 over HTTP?

    SOAP 1.1 uses text/xml. SOAP 1.2 has its own media type, application/soap+xml.
  3. 3. Which fault code names exist in SOAP 1.2?

    SOAP 1.1 faults use Client and Server; SOAP 1.2 renamed them Sender and Receiver.
  4. 4. Why would a company choose a JMS queue instead of HTTP as the SOAP transport?

    Queues give asynchronous, reliable delivery: the message waits if the receiver is offline.

Summary

  • SOAP 1.1 and 1.2 differ in namespace, content type, SOAPAction, fault format and status codes.
  • The envelope namespace identifies the version; mismatches cause a VersionMismatch fault.
  • SOAP is separate from its transport; HTTP is the default, but queues, SMTP and TCP are possible.
  • Always read the version and binding from the WSDL instead of guessing.

Next: Roles, Nodes and the Service Triangle