SOAP in the enterprise: ESBs, gateways and middleware

In large organisations SOAP rarely reaches the service directly. Knowing what the gateway does explains most production-only failures.

What the middleware does

FunctionBenefitFailure mode
TLS terminationOne place for certificatesMessage-level signatures still need to verify end to end
AuthenticationCentral policy, single audit trailThe service sees an anonymous caller and cannot authorise finely
Routing and versioningOld and new endpoints coexistPath rewriting breaks wsa:To and SOAPAction
TransformationBridging two contractsSilent field loss that only appears in reconciliation
ThrottlingProtecting the backend429 or a generic fault the client does not classify correctly
Message loggingTraceability for regulated industriesPayloads with personal data stored in plain text
Store and forwardBuffering when the backend is downDuplicate delivery when the client also retries
<!-- A gateway-added header you should expect and tolerate -->
<soap:Header>
  <gw:RoutingId xmlns:gw="urn:example:gateway">abc-123</gw:RoutingId>
  <gw:ReceivedAt xmlns:gw="urn:example:gateway">2026-09-18T10:00:03Z</gw:ReceivedAt>
  <wsse:Security><!-- the gateway may replace the original token --></wsse:Security>
</soap:Header>
# Prove where a failure happens: measure the gap between hops
curl -s -o /dev/null -w 'gateway connect=%{time_connect} total=%{time_total}\n' \
  -X POST https://gateway.example.com/orders --data-binary @req.xml

curl -s -o /dev/null -w 'direct   connect=%{time_connect} total=%{time_total}\n' \
  -X POST https://orders.internal/OrderService --data-binary @req.xml

Working with the gateway team

  • Get the exact modified request the backend receives. A gateway that rewrites the action or strips the namespace is invisible from the client side.
  • Agree on correlation: one identifier that survives the gateway and appears in both logs, so a ticket can be traced end to end.
  • Ask whether the gateway retries. If it does, the backend must be idempotent, and a duplicate on the business side is a gateway artefact, not a client bug.
  • Check the timeout budget at each hop. If the client waits 30 seconds and three hops each wait 30 seconds, the effective timeout is whatever the slowest path allows.
  • For a version migration, run both endpoints behind one gateway hostname and route by path or by action, so consumers change only their configuration.
  • Log request identifiers, not payloads, by default. When payload logging is required for compliance, redact and set a retention period.
💡
Set the client timeout shorter than the gateway's, and the gateway's shorter than the backend's. When the outermost timeout fires first, the client reports a timeout while the backend is still working — and the caller has no way to learn the outcome.

FAQ

Should our service trust the gateway's authentication?
Only with a mechanism that makes the claim verifiable, such as a signed token or mutual TLS on the internal hop. A plain header asserting a username is trivially forged by anything that can reach the backend.
How do we version a contract at the gateway?
Add a new endpoint path or a new service element and route it explicitly. Editing the existing entry in place means a rollback is the only recovery, which is exactly what you want to avoid.

Building a SOAP service: contract-first and code-first WS-Security: authentication, signing and encryption

Last refreshed 2026-09-18.