Loading…
Loading…
Explains the deterministic, full-field mapping engine that converts between SOAP/XML and REST/JSON. Covers request/response mapping, faults, and generated
The conversion engine is the core component for translating API calls between REST/JSON and SOAP/XML. Since version 1.0, it provides bidirectional conversion on a single runtime, enabling two primary use cases:
The engine's defining characteristic is its deterministic, full-field mapping. When a WSDL is imported, the platform automatically generates a complete mapping for every element in the request and response schema (XSD). This avoids manual, error-prone mapping processes and ensures that the entire data structure is converted according to the contract. There is no mediation language to author or per-service code to maintain.
This document explains the mapping model. For tunable conversion behaviors, see the conversion options reference.
The mapping process begins when an API publisher imports a WSDL. The platform's parser analyzes 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, stamped with a checksum and the parser version used to create it.
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, ensuring low conversion overhead.
The mapping is:
The diagram below 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 Facade)
C(Conversion Engine: REST → SOAP)
D(Conversion Engine: SOAP → REST)
end
subgraph Backend System
E[SOAP Backend Service]
end
A -- 1. REST/JSON Request --> B
B -- 2. Internal Call --> C
C -- 3. SOAP Request --> E
E -- 4. SOAP Response --> D
D -- 5. Internal Call --> B
B -- 6. REST/JSON Response --> AIn the Publish direction, the engine receives an inbound REST/JSON request and constructs a valid SOAP/XML envelope to send to the backend service. This involves several steps:
document/literal (wrapped and bare) and rpc/literal message styles.minOccurs and maxOccurs constraints from the XSD. If a required field is missing from the JSON request, the engine rejects the call with a validation error before it reaches the backend.null value for an element defined as nillable="true" in the XSD is converted to an XML element with an xsi:nil="true" attribute. A null value for a non-nillable element results in a validation error.xsd:sequence is preserved. For an xsd:choice, the engine enforces that exactly one of the possible branches is present.In the Consume direction, this process runs in reverse: an inbound SOAP request is parsed and validated against the schema to build the outbound REST request.
For the SOAP response from the backend, the engine produces a stable, typed JSON response for the API consumer.
soap:Envelope, soap:Body, and <OperationNameResponse> wrapper elements to expose the core payload. The exact elements to remove are determined by a recorded unwrapChain.xsi:nil="true" becomes a JSON null.NOTE
The final shape of the JSON output—including field casing, array handling, and field ordering—is controlled 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) faults.
The shape of the resulting JSON error object is determined by the error-shape conversion option, which supports:
The HTTP status code returned to the API consumer is governed by the upstream-failure-status option, which can either propagate the backend's status or mask it (e.g., as 200 OK).
WSDL-defined faults (wsdl:fault) and their detail contracts are reflected in the generated OpenAPI v3 specification, allowing API consumers to anticipate the shape of potential error responses.
The generated mapping is not a black box; it is an explicit and inspectable set of artifacts.
rules[] list of compiled instructions. Each rule defines a mapping from a fromJsonPath to a toSoapPath with its associated type, coercion rules, and namespace.unwrapChain[], and a rules[] list of instructions. Each rule defines a mapping from a fromSoapPath to a toJsonPath with its type, coercion rules, and null/array policies.Every artifact is stamped with the mapping-engine version, contract version, contract parser version, and contract checksum, providing full traceability from a live mapping back to the exact contract it was generated from.
Mappings are immutable and versioned. When a service version is activated, the platform makes its compiled mapping plan live. Any subsequent edits, such as applying a field-level override, create a new, distinct revision rather than mutating the active one. This model ensures stability and allows an API publisher to roll back to any previously active version at any time.