Loading…
Loading…
Explains the deterministic, full-field conversion engine that automatically maps between REST/JSON and SOAP based on an imported WSDL/XSD contract.
The conversion engine is the core component for bidirectional transformation between REST/JSON and SOAP messages. It enables two primary integration patterns on a single runtime, starting from version 1.0:
The engine's mapping model is deterministic and full-field. This means that for a given WSDL/XSD contract, the resulting mapping is always the same, and it covers every element in the request and response structure automatically. This approach eliminates the need for manual mapping, custom mediation logic, or per-service code.
This document describes the mapping model. For configurable behaviors that modify the output, see the Conversion options reference.
The mapping process begins when an API publisher imports a WSDL file. The platform's parser analyzes the WSDL and its associated XSDs to create a canonical contract for each operation. This contract is an immutable snapshot of the complete XSD tree for both the request and response messages, stamped with a checksum and the parser version.
From this canonical contract, the platform generates an explicit, compiled mapping plan. This plan is not re-calculated on each request; instead, it is cached for each active operation version to ensure low conversion overhead.
The "deterministic" principle ensures that the same contract always generates the identical mapping. The "full-field" principle guarantees that the mapping rules traverse the entire schema tree, including wrappers, nested complex types, arrays, choices (xsd:choice), attributes, and mixed content.
The following diagram illustrates the data flow for the "Publish" direction, where a SOAP service is exposed as a REST API.
flowchart TD
subgraph "API Consumer"
A[Client Application]
end
subgraph "API Platform"
B(REST/JSON Request) --> C{Conversion Engine<br/>Request Mapping};
C --> D(SOAP Request);
H(REST/JSON Response) --> I[A];
G{Conversion Engine<br/>Response Mapping} --> H;
F(SOAP Response) --> G;
end
subgraph "API Publisher Backend"
E[SOAP Backend Service]
end
A --sends--> B;
D --calls--> E;
E --returns--> F;
For an inbound REST/JSON request in the "Publish" direction, the engine constructs a valid SOAP envelope by performing the following steps:
minOccurs and maxOccurs constraints from the XSD. If a required field is missing from the JSON request, the engine rejects the request with a validation error before it reaches the backend.null value for a field defined as nillable="true" in the XSD is translated to an element with an xsi:nil="true" attribute. A null value for a non-nillable field results in a validation error.xsd:sequence and enforces that exactly one branch of an xsd:choice is present.In the "Consume" direction, this process is reversed: an inbound SOAP envelope is parsed and converted into an outbound REST request.
When receiving a SOAP response from the backend in the "Publish" direction, the engine produces a stable, typed JSON response:
Envelope/Body/<OperationResponse> wrappers to expose the core payload. The exact elements to remove are determined by a recorded unwrapChain from the canonical contract.xsi:nil="true" becomes a JSON null.The final structure of the JSON, including field casing, array formatting, and field order, is governed by the configured conversion options.
The engine normalizes SOAP Faults into a deterministic REST error response. It handles both SOAP 1.1 (faultcode, faultstring, detail) and SOAP 1.2 (Code/Value, Subcode) formats.
The shape of the resulting JSON error payload is controlled by the error-shape conversion option. The available shapes are:
The HTTP status code returned to the API consumer is governed by the upstream-failure-status option, which can either propagate the backend status or mask it (e.g., as 200 OK).
Furthermore, any wsdl:fault messages defined in the WSDL are automatically reflected in the generated OpenAPI v3 specification, allowing API consumers to understand the contract for potential business errors.
The generated mapping is not a black box; it is an explicit and inspectable set of artifacts. Each artifact is stamped with the mapping engine version, contract version, contract parser version, and contract checksum for clear provenance.
The primary artifacts include:
rules[] list of compiled instructions, where each rule maps a fromJsonPath to a toSoapPath and includes metadata for type, coercion, requiredness, and namespace.unwrapChain[] specifying which SOAP wrappers to remove.rules[] list of instructions, where each rule maps a fromSoapPath to a toJsonPath and includes metadata for type, coercion, null policy, and array policy.Mappings are immutable and versioned. When a service version is activated, the platform uses a snapshot of its corresponding mapping.
IMPORTANT
Any change, such as adding a field-level override, creates a new, distinct revision of the mapping rather than mutating the active one. This design ensures stability and predictability.
Because all previous versions are retained, an API publisher can roll back to any prior version of a mapping at any time.