Loading…
Loading…
Import, repair, and manage WSDL documents via API. Use file uploads, URLs, or raw XML to create service drafts and automate SOAP API onboarding.
The WSDL Import API provides a set of administrative endpoints for importing Web Services Definition Language (WSDL) documents into the platform. It is the primary mechanism for onboarding existing SOAP-based services.
API publishers can import WSDLs from various sources: direct file upload, a re<customer>e URL, or raw XML content. Upon a successful import, the platform creates a persistent WSDL artifact, identified by a unique artifactId. This artifact serves as the foundation for subsequent actions, such as:
A key function of the import process is the resolution and persistence of the WSDL's complete schema closure. The system transitively fetches all referenced WSDLs and XML Schema Definitions (XSDs) at import time. This ensures that runtime validation can be performed without making external network calls, which enhances security and reliability.
The WSDL import process follows a consistent sequence of steps, regardless of the source. The primary goal is to parse the WSDL, store it as an immutable artifact, and prepare it for service generation.
flowchart TD
subgraph "API Publisher"
A[Sends WSDL via file, URL, or XML]
end
subgraph "API Platform"
B[1. Receive request at Import Endpoint] --> C{Source Type?}
C -- File Upload --> D[Read file bytes]
C -- URL --> E[Fetch from URL]
E --> F[SSRF Egress Guard]
F --> G[Follow Redirects Manually]
G --> H[Read response bytes]
C -- Raw XML --> I[Read request body]
D --> J[2. Parse WSDL Document]
H --> J
I --> J
J --> K[3. Persist WSDL Artifact]
K --> L[4. Resolve Schema Closure]
L --> M[Fetch all wsdl:import, xsd:import, xsd:include]
M --> N[5. Persist Schema Documents]
K --> O[6. Create Audit Log]
O --> P[7. Return Artifact ID and Preview]
end
A --> B
P --> Q[Receives Artifact ID]
subgraph "API Publisher (Later)"
Q --> R[Uses Artifact ID to generate service]
endPOST /admin/v1/wsdl/import. The WSDL content is provided as a multipart file, a URL within a JSON payload, or as raw XML text.OperatorUrlGuard to prevent Server-Side Request Forgery (SSRF) vulnerabilities.WsdlParser. This process extracts key information, including the targetNamespace, a suggested backend service URL, and a list of defined SOAP operations.WsdlImportResult record is created and stored in the WsdlImportRepository. This record contains the parsed metadata, the original source information, a SHA-256 hash of the content, and the full WSDL XML payload. The system assigns a unique artifactId (UUID) to this record.WsdlSchemaClosureResolver then analyzes the imported WSDL to find all transitively referenced documents (via wsdl:import, xsd:import, and xsd:include). It attempts to fetch and store each of these documents.artifactId. This ID can then be used in subsequent API calls to generate a service or trigger autopilot onboarding.IMPORTANT
The schema closure resolution step is designed to be non-fatal. If an external schema cannot be fetched, the import still succeeds. However, a failure reason is recorded, and the artifact is marked as having an incomplete schema closure. This allows the WSDL to be used for services in monitor mode but will block enabling enforce mode for schema validation.
This example uploads a WSDL file to create a new WSDL artifact.
curl -X POST "https://<platform-host>/admin/v1/wsdl/import" \
-H "Authorization: Bearer <API_TOKEN>" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/service.wsdl"
A successful request returns an HTTP 200 OK status and a JSON body containing the import preview, which includes the generated artifactId.
This example demonstrates a two-step process: first, import a WSDL from a public URL, and second, use the resulting artifactId to generate a new service draft.
Step 1: Import from URL
curl -X POST "https://<platform-host>/admin/v1/wsdl/import-url" \
-H "Authorization: Bearer <API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"url": "http://example.com/service?wsdl"
}'
The response will contain the artifactId. Assume it is a1b2c3d4-e5f6-7890-1234-567890abcdef.
Step 2: Generate Service
curl -X POST "https://<platform-host>/admin/v1/wsdl/import/a1b2c3d4-e5f6-7890-1234-567890abcdef/generate-service" \
-H "Authorization: Bearer <API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"serviceKey": "my-new-service",
"serviceName": "My New SOAP Service",
"environment": "dev",
"direction": "PUBLISH"
}'
A successful request returns an HTTP 200 OK status and a JSON body with details of the generated service version, including its versionId.
These endpoints handle the creation and retrieval of WSDL artifacts.
POST /admin/v1/wsdl/import
Imports a WSDL provided as a multipart file upload.
multipart/form-dataapplication/jsonRequest Parts
| Name | Type | Required | Description |
|---|---|---|---|
file | MultipartFile | Yes | The WSDL file to import. |
Responses
200 OK: Successful import. The body contains an import preview object.400 Bad Request: The file is empty (S2R-ADM-1400) or the WSDL is malformed (S2R-ADM-1401).500 Internal Server Error: An unexpected error occurred (S2R-ADM-1500).POST /admin/v1/wsdl/import-url
Imports a WSDL from a specified URL. The platform fetches the WSDL content from the URL.
application/jsonapplication/jsonRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
url | String | Yes | The URL of the WSDL to import. Must use http or https. |
Responses
200 OK: Successful import. The body contains an import preview object.400 Bad Request: The url is missing, invalid, or blocked (S2R-ADM-1402); the URL fetch failed (S2R-ADM-1403); the response from the URL was empty (S2R-ADM-1400); or the WSDL is malformed (S2R-ADM-1401).500 Internal Server Error: An unexpected error occurred (S2R-ADM-1500).POST /admin/v1/wsdl/import-xml
Imports a WSDL provided as raw XML in the request body. This is useful for importing repaired or manually constructed WSDLs.
application/json, text/plainapplication/jsonRequest Body
The body can be a JSON object or raw XML text.
| Field | Type | Required | Description |
|---|---|---|---|
wsdlXml | String | Yes | The raw WSDL XML content. Required if the body is JSON. If the body is text/plain, it is the entire payload. |
sourceName | String | No | An optional name for the source, e.g., "repaired.wsdl". |
sourceType | String | No | An optional type for the source, e.g., "repaired_xml". |
Responses
200 OK: Successful import. The body contains an import preview object.400 Bad Request: The XML content is missing (S2R-ADM-1402) or the WSDL is malformed (S2R-ADM-1401).500 Internal Server Error: An unexpected error occurred (S2R-ADM-1500).GET /admin/v1/wsdl/import/{artifactId}
Retrieves the import preview details for a previously imported WSDL artifact.
application/jsonPath Parameters
| Name | Type | Description |
|---|---|---|
artifactId | UUID | The unique identifier of the WSDL artifact. |
Responses
200 OK: The body contains the import preview object.404 Not Found: No WSDL artifact with the specified ID was found (S2R-ADM-1404).GET /admin/v1/services/{serviceId}/versions/{versionId}/inbound-wsdl
Downloads the original WSDL file that was used to create a specific service version.
application/wsdl+xmlPath Parameters
| Name | Type | Description |
|---|---|---|
serviceId | UUID | The unique identifier of the service. |
versionId | UUID | The unique identifier of the service version. |
Responses
200 OK: The body contains the raw WSDL XML content.404 Not Found: The service version was not found, is not linked to a WSDL artifact, or the WSDL payload was not stored for the artifact (for very old imports) (S2R-ADM-0404).These endpoints use existing WSDL artifacts to create or configure services.
POST /admin/v1/wsdl/import/{artifactId}/generate-service
Creates a new draft service version from a WSDL artifact. If serviceKey is omitted, the system suggests one based on the WSDL content.
application/jsonapplication/jsonPath Parameters
| Name | Type | Description |
|---|---|---|
artifactId | UUID | The unique identifier of the WSDL artifact. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
serviceKey | String | No | A unique key for the service. If omitted, a key is suggested from the WSDL. |
serviceName | String | No | A human-readable name for the service. If omitted, a name is suggested from the WSDL. |
environment | String | No | The target environment for the service draft. If omitted, a value is suggested. |
direction | String | No | Service direction. Supported values: PUBLISH, CONSUME, GATEWAY. Defaults to PUBLISH. See Direction Parameter. |
Responses
200 OK: Service draft created successfully. The body contains details of the generated service version.400 Bad Request: The artifact was not found, the request was invalid (S2R-ADM-1403), the direction is unsupported (S2R-VAL-0403), or the WSDL failed contract validation (WsdlContractValidationException.CODE).500 Internal Server Error: An unexpected error occurred during generation (S2R-ADM-1501).Autopilot endpoints provide a "zero-touch" workflow by combining import and service generation into a single call.
POST /admin/v1/wsdl/import/{artifactId}:autopilot
Triggers autopilot onboarding from an existing WSDL artifact.
application/jsonapplication/jsonPath Parameters
| Name | Type | Description |
|---|---|---|
artifactId | UUID | The unique identifier of the WSDL artifact. |
Request Body: Same as generate-service.
Responses
200 OK: Autopilot process completed. The body contains the results, including the generated service details.400 Bad Request: Invalid request (S2R-ADM-1403), unsupported direction (S2R-VAL-0403), or contract validation failure (WsdlContractValidationException.CODE).500 Internal Server Error: An unexpected autopilot failure occurred (S2R-ADM-1502).POST /admin/v1/wsdl/import:autopilot
Imports a WSDL from a file and immediately triggers autopilot onboarding.
multipart/form-dataapplication/jsonRequest Parts
| Name | Type | Required | Description |
|---|---|---|---|
file | MultipartFile | Yes | The WSDL file to import. |
serviceKey | String | No | A unique key for the service. |
serviceName | String | No | A human-readable name for the service. |
environment | String | No | The target environment. |
direction | String | No | Service direction. Supported values: PUBLISH, CONSUME, GATEWAY. Defaults to PUBLISH. See Direction Parameter. |
Responses
200 OK: Autopilot process completed.400 Bad Request: Empty file (S2R-ADM-1400), malformed WSDL (S2R-ADM-1401), invalid arguments (S2R-ADM-1403), or contract validation failure (WsdlContractValidationException.CODE).500 Internal Server Error: An unexpected autopilot failure occurred (S2R-ADM-1502).POST /admin/v1/wsdl/import-url:autopilot
Imports a WSDL from a URL and immediately triggers autopilot onboarding.
application/jsonapplication/jsonRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
url | String | Yes | The URL of the WSDL to import. |
serviceKey | String | No | A unique key for the service. |
serviceName | String | No | A human-readable name for the service. |
environment | String | No | The target environment. |
direction | String | No | Service direction. Supported values: PUBLISH, CONSUME, GATEWAY. Defaults to PUBLISH. See Direction Parameter. |
Responses
200 OK: Autopilot process completed.400 Bad Request: Invalid arguments (S2R-ADM-1402), malformed WSDL (S2R-ADM-1401), or contract validation failure (WsdlContractValidationException.CODE).500 Internal Server Error: An unexpected autopilot failure occurred (S2R-ADM-1502).POST /admin/v1/wsdl/import-xml:autopilot
Imports a WSDL from raw XML text and immediately triggers autopilot onboarding.
application/json, text/plainapplication/jsonRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
wsdlXml | String | Yes | The raw WSDL XML content. |
sourceName | String | No | An optional name for the source. |
sourceType | String | No | An optional type for the source. |
serviceKey | String | No | A unique key for the service. |
serviceName | String | No | A human-readable name for the service. |
environment | String | No | The target environment. |
direction | String | No | Service direction. Supported values: PUBLISH, CONSUME, GATEWAY. Defaults to PUBLISH. See Direction Parameter. |
Responses
200 OK: Autopilot process completed.400 Bad Request: Invalid arguments (S2R-ADM-1402), malformed WSDL (S2R-ADM-1401), or contract validation failure (WsdlContractValidationException.CODE).500 Internal Server Error: An unexpected autopilot failure occurred (S2R-ADM-1502).These endpoints support autopilot onboarding for multiple WSDLs in a single request.
POST /admin/v1/wsdl/import-urls:autopilot
Executes autopilot for a batch of WSDLs specified by URLs.
application/jsonapplication/jsonRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
urls | Array<String> | No | A list of WSDL URLs to process. Either urls or items must be provided. |
items | Array<Object> | No | A list of item objects, each with url, and optional serviceKey, serviceName, and environment. |
environment | String | No | A shared environment for all items in the batch, unless overridden at the item level. |
direction | String | No | A shared service direction for all items. Supported values: PUBLISH, CONSUME, GATEWAY. See Direction Parameter. The source does not specify a default, but resolveDirection implies a PUBLISH default. |
Responses
200 OK: Batch process completed. The body contains a report of successes and failures.400 Bad Request: Invalid request body (S2R-ADM-1402).500 Internal Server Error: An unexpected batch failure occurred (S2R-ADM-1502).POST /admin/v1/wsdl/import-files:autopilot
Executes autopilot for a batch of WSDLs provided as uploaded files.
multipart/form-dataapplication/jsonRequest Parts
| Name | Type | Required | Description |
|---|---|---|---|
files | Array<MultipartFile> | Yes | An array of WSDL files to process. |
environment | String | No | A shared environment for all services generated in the batch. |
direction | String | No | A shared service direction for all items. Supported values: PUBLISH, CONSUME, GATEWAY. See Direction Parameter. |
Responses
200 OK: Batch process completed.400 Bad Request: No files provided or a file is empty (S2R-ADM-1400).500 Internal Server Error: An unexpected batch failure occurred (S2R-ADM-1502).These endpoints provide tools to diagnose and fix common issues in WSDL documents before import.
POST /admin/v1/wsdl/namespace-repair-preview
Analyzes a WSDL for missing namespace declarations and returns a repaired XML version.
wsdlXml or url, and an optional namespaceMappings object for manual overrides.repairedXml.POST /admin/v1/wsdl/external-reference-preview
Analyzes a WSDL for external references (wsdl:import, xsd:import, xsd:include) and reports on their resolution status.
wsdlXml or url.resolved or failed).POST /admin/v1/wsdl/repair-report
Generates a comprehensive JSON report combining namespace and external reference analysis.
wsdlXml or url, and optional namespaceMappings.POST /admin/v1/wsdl/repair-package
Generates and downloads a ZIP archive containing the repaired WSDL, all resolved external schemas, placeholder files for failed references, and a JSON manifest.
wsdlXml or url, and optional namespaceMappings.application/zip file.Several endpoints accept a direction parameter. This field specifies the role of the service being created.
PUBLISH: (Default) The WSDL describes a backend SOAP service that the platform will expose as a new API.CONSUME: The WSDL describes a SOAP API that the platform will expose to clients, which is then backed by a REST service.GATEWAY: The WSDL describes a contract for a SOAP-to-SOAP broker service.If the direction parameter is provided with an unsupported value, the API will respond with a 400 Bad Request and error code S2R-VAL-0403.
| Error Code | HTTP Status | Meaning |
|---|---|---|
S2R-ADM-1400 | 400 Bad Request | The uploaded WSDL file, fetched URL content, or XML payload is empty. |
S2R-ADM-1401 | 400 Bad Request | WsdlParseException. The provided WSDL content is not well-formed XML or is invalid according to WSDL parsing rules. The message contains details. |
S2R-ADM-1402 | 400 Bad Request | The request is invalid. Typically, a required field like url is missing or the request body is malformed JSON. |
S2R-ADM-1403 | 400 Bad Request | An IllegalArgumentException occurred. This can be caused by a failed URL fetch, a non-existent artifact ID, or other invalid arguments. |
S2R-ADM-1404 | 404 Not Found | The specified artifactId does not exist. |
S2R-ADM-0404 | 404 Not Found | The requested service version or its associated WSDL artifact could not be found. May also indicate an old artifact with no stored payload. |
S2R-VAL-0403 | 400 Bad Request | The direction parameter is not one of the supported values (PUBLISH, CONSUME, GATEWAY). |
WsdlContractValidationException.CODE | 400 Bad Request | The WSDL failed a contract validation rule during service generation or autopilot. The response details object contains specific issues. |
OperatorUrlBlockedException code | 400 Bad Request | The requested WSDL URL was blocked by the SSRF egress guard. The reason (e.g., disallowed IP range) is included in the error message. |
S2R-ADM-1500 | 500 Internal Server Error | An unexpected failure occurred during a generic import, repair, or preview operation. |
S2R-ADM-1501 | 500 Internal Server Error | An unexpected failure occurred during the generate-service step. |
S2R-ADM-1502 | 500 Internal Server Error | An unexpected failure occurred during an autopilot or autopilot.batch operation. |