Loading…
Loading…
Technical reference for the Runtime API, the live data plane for SOAP-to-REST and REST-to-SOAP conversions. Details endpoints, headers, and errors.
The Runtime API is the live data plane for all conversion traffic. It is the endpoint that API consumers interact with, typically through an API gateway or ingress controller. The Runtime API itself is designed for internal network access and should not be exposed directly to the public internet.
Its core function is to receive an inbound request, match it to a configured service operation, and perform a protocol and payload transformation. This process is bidirectional, supporting two primary conversion flows identified by a mandatory direction segment in the request path:
publish: Exposes a SOAP backend as a modern REST/JSON API. API consumers make REST requests, and the runtime converts them into SOAP requests for the backend.consume: Exposes a REST backend as a traditional SOAP web service. This allows legacy SOAP clients to interact with new or migrated REST services without modification.Every request processed by the runtime is assigned a unique correlation ID, which is returned in the X-Correlation-Id response header to facilitate tracing and debugging.
The runtime's behavior is determined by the direction segment of the incoming request URL. It routes traffic, performs transformations, and interacts with backend services based on this direction.
All requests to the runtime follow the path pattern /{direction}/{environment}/{serviceKey}/{operationPath...}. The runtime first inspects the {direction} segment to determine the conversion flow (publish or consume). It then strips this segment and uses the remaining path (/{environment}/{serviceKey}/{operationPath...}) to match the request against a stored route configuration.
The following diagram illustrates the two conversion flows:
flowchart TD
subgraph "API Consumer"
direction LR
A[REST Client]
B[SOAP Client]
end
subgraph "API Gateway / Ingress"
C(Gateway)
end
subgraph "Runtime API"
D{Request Router<br>/direction/...}
D -- /publish --> E[REST-to-SOAP Conversion]
D -- /consume --> F[SOAP-to-REST Conversion]
end
subgraph "Backend Services"
G[SOAP Backend]
H[REST Backend]
end
A -- REST Request --> C
B -- SOAP Request --> C
C --> D
E -- SOAP Request --> G
G -- SOAP Response --> E
E -- REST Response --> C
F -- REST Request --> H
H -- REST Response --> F
F -- SOAP Response --> C
C -- REST Response --> A
C -- SOAP Response --> BWhen the direction is publish, the runtime exposes a SOAP backend as a REST API.
POST, GET, DELETE) to a /publish/... endpoint. The primary inbound content type is application/json.GET or DELETE requests, any path placeholders and query string parameters are merged into a single effective JSON payload.result object. If the backend returns a SOAP Fault, it is mapped to a standard JSON error envelope.When the direction is consume, the runtime exposes a REST backend as a SOAP web service, ensuring continuity for legacy clients.
POST request containing a SOAP envelope to a /consume/... endpoint.text/xml) and SOAP 1.2 (application/soap+xml) and automatically detects the version from the envelope's namespace.The Runtime API uses a structured path to identify the service, operation, and conversion direction.
The base path for all runtime operations follows this pattern:
/{direction}/{environment}/{serviceKey}/{operationPath...}
direction: Must be either publish or consume. A request with a missing or incorrect direction will be rejected with HTTP 400 and error code S2R-RUN-0405.environment: The deployment environment (e.g., dev, prod).serviceKey: The unique identifier for the service.operationPath: The path identifying the specific operation within the service.Examples:
# Publish direction: Exposing a SOAP backend as REST
POST /publish/dev/vehicle/license-status
GET /publish/dev/citizen/{citizenId}
# Consume direction: Exposing a REST backend as SOAP
POST /consume/prod/legacy-citizen/get-citizen
PUBLISH Direction (/publish/...)Exposes a SOAP backend as a REST API.
POST, GET, DELETE.Content-Type: application/json. Per-operation, application/xml can be accepted for SOAP-fragment passthrough.GET and DELETE requests, path and query string parameters are supported and are merged into the JSON payload before conversion.A successful publish request returns a 200 OK with a standard JSON envelope containing metadata and the result.
{
"correlationId": "...",
"environment": "prod",
"path": "/publish/prod/vehicle/license-status",
"serviceKey": "vehicle",
"operationKey": "license-status",
"backendLatencyMs": 38,
"result": { "...": "mapped SOAP payload" }
}
Errors on the publish path are returned in a standard JSON error envelope. See the Troubleshooting section for common error codes.
CONSUME Direction (/consume/...)Exposes a REST backend as a SOAP API.
POST only. Using any other HTTP method on a /consume path will result in an HTTP 405 error (S2R-RUN-0411).Content-Type:
text/xml for SOAP 1.1application/soap+xml for SOAP 1.2All errors on the consume path, including validation failures and backend errors, are returned as a SOAP Fault envelope. This ensures that the SOAP client receives an error in the format it expects. The fault will contain the relevant S2R-* error code.
For each consume service, the runtime serves a dynamically generated Web Services Description Language (WSDL) file. This file acts as the formal contract for SOAP clients.
GET /consume/{env}/{serviceKey}?wsdlGET /consume/{env}/{serviceKey}/wsdlContent-Type of application/wsdl+xml; charset=UTF-8.500 error with code S2R-RUN-0421.The runtime includes several features to ensure resilience when communicating with backend services.
The runtime applies timeout and retry policies to backend calls, which can be configured on a per-operation basis.
1000 ms2In the consume direction, retries use a capped exponential backoff strategy, configured via retry_count and retry_backoff_ms in the backend profile.
The runtime implements a process-local circuit breaker for each backend endpoint to prevent repeated calls to a failing service.
503 Service Unavailable error (S2R-RUN-0529). After a cooldown period, the breaker enters a "half-open" state, allowing a single probe request to pass through. If it succeeds, the breaker closes; if it fails, the breaker re-opens.| Variable | Default | Description |
|---|---|---|
S2R_RUNTIME_CB_FAILURE_THRESHOLD | 5 | The number of consecutive failures required to open the circuit. |
S2R_RUNTIME_CB_OPEN_SECONDS | 30 | The number of seconds the circuit remains open before moving to the half-open state. |
Operations can be configured with a fallback policy to handle specific transport failures (timeout, io_error, unknown_error, circuit_open). When a configured failure occurs and a fallback is defined, the runtime returns a pre-configured static payload and status code instead of an error.
When a fallback is triggered, the response will include the header X-S2R-Fallback: true.
The runtime processes the following HTTP headers on inbound requests.
| Header | Direction | Description |
|---|---|---|
Content-Type | Both | Specifies the payload format. Required for requests with a body. For publish, the primary type is application/json. For consume, it must be text/xml (SOAP 1.1) or application/soap+xml (SOAP 1.2). |
Accept | publish | Specifies the desired response format for the client. Defaults to application/json. |
X-Correlation-Id | Both | An optional, client-provided correlation ID for tracing. If absent, the runtime generates a new one. The final ID is always echoed in the response. |
X-Debug-Enabled | Both | An optional header to enable extended debugging features. This is honored only for authorized internal callers as determined by platform policy. |
The maximum synchronous payload size is 30 MB.
413 Payload Too Large status and error code S2R-RUN-0413.publish path, the error is a JSON envelope.consume path, the error is a soap:Client Fault.The platform handles UTF-8 encoding end-to-end. This includes REST JSON payloads, generated SOAP XML, backend responses, and saved traces.
When calling a SOAP backend (publish direction), the runtime uses the soap_version configured in the backend profile to construct the correct envelope.
http://schemas.xmlsoap.org/soap/envelope/ namespace and sends Content-Type: text/xml; charset=utf-8. It may also include a SOAPAction header.http://www.w3.org/2003/05/soap-envelope namespace and sends Content-Type: application/soap+xml; charset=utf-8. Any SOAP action is included as a media-type parameter (e.g., action="...").The runtime can authenticate to backends using several methods, configured in the backend profile. Credential material is stored encrypted and decrypted on-demand by the runtime.
none, basic, bearer, api_key_header, oauth2_client_credentials.mtls_enabled=true can be combined with any authentication type. It applies to both the direct backend call and any calls to an OAuth2 token endpoint.WARNING
The runtime performs critical checks at startup. If a configured credential key is missing (S2R-RUN-0419) or an mTLS certificate is missing or unparseable (S2R-RUN-0420), the runtime will refuse to accept traffic.
The runtime returns specific error codes to help diagnose issues. On the publish path, these are in a JSON error envelope. On the consume path, they are inside a SOAP Fault.
| Error Code | HTTP Status | Direction | Description |
|---|---|---|---|
S2R-RUN-0404 | 404 Not Found | Both | The request path did not match any published service operation. |
S2R-RUN-0405 | 400 Bad Request | Both | The required /publish/ or /consume/ direction segment was missing or misspelled in the URL. The error includes a suggestedPath. |
S2R-RUN-0408 | 400 Bad Request | consume | The Content-Type header was not text/xml or application/soap+xml. |
S2R-RUN-0409 | 400 Bad Request | consume | The inbound SOAP envelope was malformed and could not be parsed. |
S2R-RUN-0410 | (Varies) | consume | The REST backend returned an error (e.g., a 4xx status code). Returned as a soap:Client fault. |
S2R-RUN-0411 | 405 Method Not Allowed | consume | The request used a method other than POST. |
S2R-RUN-0413 | 413 Payload Too Large | Both | The request body exceeded the 30 MB limit. |
S2R-RUN-0419 | (Startup) | N/A | A required credential decryption key was not found at startup. |
S2R-RUN-0420 | (Startup) | N/A | A configured mTLS certificate could not be found or parsed at startup. |
S2R-RUN-0421 | 500 Internal Server Error | consume | The stored WSDL for a service could not be parsed when requested via the ?wsdl endpoint. |
S2R-RUN-0424 | 504 Gateway Timeout | publish | The backend service did not respond within the configured timeout. |
S2R-RUN-0429 | 503 Service Unavailable | publish | The backend call failed after all configured retries were exhausted. |
S2R-RUN-0502 | 502 Bad Gateway | publish | The SOAP backend returned a SOAP Fault. |
S2R-RUN-0505 | 500 Internal Server Error | consume | A misconfiguration was detected for the backend authentication (e.g., missing credentials). |
S2R-RUN-0506 | 500 Internal Server Error | Both | A data contract error occurred, such as failure to build a SOAP envelope or a backend response that did not match the expected structure. |
S2R-RUN-0529 | 503 Service Unavailable | Both | The circuit breaker for the backend service is open. |
S2R-VAL-0400 | 400 Bad Request | publish | The inbound JSON request payload failed validation against the operation's schema. |