Loading…
Loading…
Explains the deterministic, full-field mapping model for converting between REST/JSON and SOAP, including request/response mapping and fault normalization.
The conversion engine is the core component responsible for translating API calls between REST/JSON and SOAP formats. It enables API publishers to expose a modern REST/JSON interface for a backend SOAP service, or to consume a REST service from a SOAP-based client, without writing or maintaining per-service mediation code.
The engine operates bi-directionally on a single runtime:
The engine's mapping model is deterministic and full-field. This means that for a given WSDL/XSD contract, the conversion rules are generated automatically to cover every element in the schema, and the output is always the same for a given input. The mapping is a compiled, cached plan, ensuring low-latency conversions.
The conversion process begins when an API publisher imports a WSDL. The platform parses the WSDL and its associated XSDs to create a canonical contract for each operation. This contract is an immutable, versioned snapshot of the full request and response schema trees. From this contract, the engine generates an explicit set of mapping rules.
"Deterministic" means the same contract always produces the same mapping. "Full-field" means the generated rules traverse the entire schema tree, including wrappers, nested complex types, arrays, choices, attributes, and mixed content.
The following diagram illustrates the data flow for the "Publish" direction, where a REST API call is converted to a backend SOAP call.
sequenceDiagram
participant C as API Consumer
participant P as API Platform
participant B as SOAP Backend
C->>P: 1. REST/JSON Request
P->>P: 2. Convert to SOAP using<br/>compiled mapping plan
P->>B: 3. SOAP Request
B-->>P: 4. SOAP Response / Fault
P->>P: 5. Convert to REST/JSON using<br/>compiled mapping plan
P-->>C: 6. REST/JSON Response / ErrorFor an inbound REST/JSON request in the Publish direction, the engine constructs a valid SOAP envelope by performing the following steps:
document/literal (wrapped and bare) and rpc/literal styles.minOccurs and maxOccurs constraints from the schema. If a required field is missing from the request, the engine rejects the call with a validation error before it reaches the backend.null values according to the schema. A null for an element defined as nillable="true" becomes an element with an xsi:nil="true" attribute. A null for a non-nillable element results in a validation error.xsd:sequence and enforces that exactly one branch of an xsd:choice is present.When receiving a SOAP response from the backend, the engine produces a stable, typed JSON object for the API consumer:
Envelope/Body/<OperationResponse> wrappers to expose the core payload, following the unwrapChain recorded in the mapping artifact.null list.xsi:nil="true" becomes a JSON null.The engine normalizes SOAP Faults into a deterministic REST error shape. It handles both SOAP 1.1 (faultcode, faultstring, detail) and SOAP 1.2 (Code/Value, Subcode) faults.
The final shape of the error response is determined by the error-shape conversion option, which supports:
The HTTP status code returned to the consumer is controlled by the upstream-failure-status option. WSDL-declared faults (wsdl:fault) and their detail contracts are reflected in the generated OpenAPI v3 specification, allowing API consumers to anticipate error structures.
The generated mapping is an explicit, inspectable artifact, not a black box. Each artifact contains metadata that links it to its exact origin, including the mapping-engine version, contract version, contract parser version, and contract checksum.
rules[] list of compiled instructions. Each rule defines a mapping from a fromJsonPath to a toSoapPath with its associated type, coercion rules, requiredness, and namespace.unwrapChain[] used to locate the payload, and a rules[] list. Each rule defines a mapping from a fromSoapPath to a toJsonPath with its type, coercion rules, and null/array handling policies.200 OK) response.Since v1.0, mappings are immutable and versioned. When a service version is activated, the platform uses a snapshot of its mapping. Any change, such as a field-level override, creates a new, distinct revision rather than modifying the active one. This design allows API publishers to roll back to any previously active version at any time.
The behavior of the conversion engine can be tuned with various options. The source for this document mentions the following options. For a complete reference, see Conversion options reference.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
error-shape | string | — | No | Defines the JSON structure for normalized SOAP Faults. Supported values include a platform default, RFC 7807 Problem Details, flat, or passthrough. |
upstream-failure-status | string | — | No | Governs the HTTP status code returned for a backend failure. Can be set to propagate the backend status or mask it (e.g., as 200 OK). |
The engine can produce errors at two main stages: during request validation or upon receiving a fault from the backend.
These errors occur before the request is sent to the backend SOAP service. They are triggered by an inbound REST request that violates the WSDL/XSD contract.
minOccurs="1" (or a higher value).maxOccurs.null value for a field that is not nillable="true" in the schema.xsd:choice: The request provides more than one of the possible elements within an xsd:choice structure.If the backend service returns a <soap:Fault>, the engine normalizes it into a REST error response as described in the Fault Normalization section. The structure and status code of the final error are determined by the error-shape and upstream-failure-status conversion options.