Loading…
Loading…
Technical reference for the Runtime API, the live data-plane for SOAP-2-REST conversions. Details the publish and consume directions and error handling.
The Runtime API is the live data-plane traffic endpoint for the SOAP-2-REST platform. It is the sole API surface that API consumers and legacy SOAP clients interact with directly. The runtime is an internal-only component, designed to be placed behind an API publisher's own ingress or gateway, which handles inbound authentication.
When a request arrives, the runtime performs the following sequence of operations:
All operations are tracked with a correlation ID, which is either provided by the caller or generated by the runtime.
The core of the Runtime API is a path-based routing system that distinguishes between two fundamental conversion directions: publish (exposing a SOAP backend as REST) and consume (exposing a REST backend as SOAP).
All runtime requests must follow a specific path pattern:
/{direction}/{environment}/{serviceKey}/{operationPath...}
direction: Must be either publish or consume. This segment is mandatory. The runtime strips this segment before matching against the stored route (/{environment}/{serviceKey}/{operationKey}), but uses the direction to control the conversion logic.environment: The deployment environment, e.g., dev or prod.serviceKey: The unique identifier for the service.operationPath...: The path identifying the specific operation within the service.A request that omits or misspells the direction segment (e.g., /{env}/{serviceKey}) is rejected with an HTTP 400 and error code S2R-RUN-0405. The error response includes a suggestedPath field that prepends /publish/ to the attempted path. A request with a valid direction that does not match any published route receives an HTTP 404 with error code S2R-RUN-0404.
Example Paths:
# Publish direction: Exposing a SOAP backend as a REST API
POST /publish/dev/vehicle/license-status
POST /publish/prod/mot/data-sent-to-office-request
GET /publish/dev/citizen/{citizenId}
# Consume direction: Exposing a REST backend as a SOAP service
POST /consume/prod/legacy-citizen/get-citizen
publish Direction: REST in, SOAP outThe publish direction exposes a SOAP backend as a modern REST/JSON API.
POST /publish/{env}/{serviceKey}/{op...}Content-Type is application/json. application/xml is also accepted on a per-operation basis for SOAP-fragment passthrough. For GET or DELETE methods, path placeholders and query-string parameters are merged into an effective JSON payload before conversion.X-Correlation-Id and Content-Type headers, along with a normalized JSON body.Example publish Success Response:
{
"correlationId": "...",
"environment": "prod",
"path": "/publish/prod/vehicle/license-status",
"serviceKey": "vehicle",
"operationKey": "license-status",
"backendLatencyMs": 38,
"result": { "...": "mapped SOAP payload" }
}
consume Direction: SOAP in, REST outThe consume direction provides a SOAP facade for a REST backend, allowing legacy SOAP clients to work with migrated services without modification.
POST /consume/{env}/{serviceKey}/{op...}. This path accepts POST requests only. Any other HTTP method will result in a 405 Method Not Allowed response with error code S2R-RUN-0411.Content-Type:
text/xmlapplication/soap+xml
The runtime automatically detects the SOAP version from the envelope namespace and formats the response in the same version.consume service makes its contract available as a WSDL document. The WSDL can be retrieved via a GET request to either of the following paths:
GET /consume/{env}/{serviceKey}?wsdlGET /consume/{env}/{serviceKey}/wsdl
The response will have a Content-Type of application/wsdl+xml; charset=UTF-8.| Header | Direction | Notes |
|---|---|---|
Content-Type | Both | application/json (primary for publish); text/xml or application/soap+xml for consume. |
Accept | publish | Defaults to application/json. |
X-Correlation-Id | Both | Optional on request. The runtime generates one if absent and always includes it on the response. |
X-Debug-Enabled | Both | Optional. Honored only for authorized internal callers or policies. |
413 Payload Too Large status and error code S2R-RUN-0413. The error details include maxPayloadMb=30. The error format is a JSON envelope for publish routes and a SOAP Fault for consume routes.The runtime includes several features for resilient integration with backend services.
1000 ms2Both settings can be overridden on a per-operation basis from the control plane. For consume routes, retries use a capped exponential backoff strategy.
The runtime implements a process-local circuit breaker for each backend endpoint to prevent cascading failures.
503 Service Unavailable and error code S2R-RUN-0529.These values are tunable via the following environment variables:
S2R_RUNTIME_CB_FAILURE_THRESHOLDS2R_RUNTIME_CB_OPEN_SECONDSOperations can be configured with a fallback policy for transport failures (timeout, io_error, unknown_error, circuit_open). If a fallback is triggered, the runtime returns a pre-configured payload and status code. The response will include the header X-S2R-Fallback: true.
The runtime manages credentials and protocol details for backend calls.
none, basic, bearer, api_key_header, and oauth2_client_credentials. Mutual TLS (mtls_enabled=true) can be applied to any backend call, including the token endpoint call for OAuth2. Credentials are encrypted and decrypted on demand.Content-Type based on the backend's configured soap_version.
http://schemas.xmlsoap.org/soap/envelope/, text/xml; charset=utf-8. May include a SOAPAction header.http://www.w3.org/2003/05/soap-envelope, application/soap+xml; charset=utf-8. May include an action parameter in the media type.Error responses from the Runtime API depend on the direction of the request.
publish direction: Errors are returned in a standard JSON error envelope with an S2R-* error code.consume direction: All errors are returned as a SOAP Fault envelope to satisfy the expectations of a SOAP client. The fault will contain the relevant S2R-* error code.| Error Code | HTTP Status | Trigger Condition |
|---|---|---|
S2R-RUN-0404 | 404 | A validly formed request path that does not match any published route. |
S2R-RUN-0405 | 400 | The direction segment (/publish/ or /consume/) is missing or misspelled. |
S2R-RUN-0408 | 400 | An unsupported Content-Type was sent to a /consume endpoint. |
S2R-RUN-0409 | 400 | The SOAP envelope on a /consume request is malformed. |
S2R-RUN-0410 | (Varies) | The REST backend for a /consume route returned a 4xx client error. |
S2R-RUN-0411 | 405 | A non-POST method was used on a /consume path. |
S2R-RUN-0413 | 413 | Request payload exceeds the 30 MB limit. |
S2R-RUN-0419 | (Startup) | A required credential key is missing at runtime startup. |
S2R-RUN-0420 | (Startup) | A required mTLS certificate is missing or unparseable at startup. |
S2R-RUN-0421 | 500 | The stored WSDL for a /consume service could not be parsed. |
S2R-RUN-0424 | (Varies) | Backend call timed out. |
S2R-RUN-0429 | (Varies) | Backend call failed after all retries were exhausted. |
S2R-RUN-0502 | 502 | The SOAP backend returned a SOAP fault. |
S2R-RUN-0505 | (Varies) | Backend authentication configuration is missing or invalid. |
S2R-RUN-0506 | (Varies) | Backend response does not match the expected contract (drift). |
S2R-RUN-0529 | 503 | The circuit breaker for the backend is open. |
S2R-VAL-0400 | 400 | General request validation failure. |