Guide

How to troubleshoot a SOAP fault

When a SOAP call fails, the answer is usually in the response, but you have to know where to look. This checklist takes you from the first clue to the likely cause.

What a SOAP fault is

When a service cannot process a request, it returns a Fault element inside the response body. SOAP 1.1 faults are normally sent with HTTP status 500. A fault is a polite error message in XML.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>
    <soapenv:Fault>
      <faultcode>soapenv:Client</faultcode>
      <faultstring>Invalid value for Region</faultstring>
    </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>

SOAP 1.1 uses faultcode and faultstring. SOAP 1.2 uses Code and Reason. In both, a Client fault (called Sender in SOAP 1.2) means the request was wrong. A Server fault (called Receiver in SOAP 1.2) means the service had a problem of its own.

The checklist

  1. Read the whole response, not just the status. Is it a SOAP fault, or an HTML error page from a gateway or firewall? An HTML page means your request may never have reached the service.
  2. Check the address and the environment. Mixing up test and live addresses is one of the most common mistakes.
  3. Check the action. SOAP 1.1 sends a SOAPAction header. SOAP 1.2 puts an action parameter in the Content-Type header. A wrong value can be rejected before your request is even read.
  4. Check namespaces. A correct element name in the wrong namespace is treated as an unknown element.
  5. Check required fields and order. XML Schema often demands that elements appear in a fixed order.
  6. Check data formats. Dates, decimals, IDs with leading zeros and empty values versus missing values cause many faults.
  7. Check credentials and sessions. An expired token, a closed session or credentials from the wrong environment will stop a request.
  8. Check time and size. Slow back ends and very large messages can time out.
  9. Compare with a request that worked. Change one thing at a time until the fault appears or disappears.
  10. If nothing comes back at all, look at the network, firewall rules and security certificates.

Quick reference

What you seeLikely cause
An HTML page instead of XMLA gateway, a firewall or a wrong address
A Client or Sender fault that names a fieldBad or missing data in the request
A fault about an unexpected elementA namespace or ordering problem
A fault about authentication or sessionAn expired or missing token
HTTP 401 or 403Wrong credentials or missing permission
No response, then a timeoutNetwork, firewall or a slow back end

Share failures safely

Before you send a failed request to a colleague or a vendor, remove or mask credentials, tokens and customer data. Pasting a raw request into chat or email is how sensitive details leak.

Knotless lets you share a failed request in a controlled way, mask sensitive fields and replay it, so the person helping you sees what you saw without seeing what they should not.

Make the next fault easier

New to the file behind the service? Start with what a WSDL is.

Keep reading

See it on your own services

Knotless is a Windows workbench from Hisia Solutions. Trial licences are provisioned for evaluation. Bring one WSDL and we will walk through it with your team.