6. Web Services with SOAP and WSDL

wsdl2openapi

Version

The wsdl2openapi interceptor exposes SOAP/WSDL services via HTTP/JSON/OpenAPI. It automatically converts JSON requests to SOAP XML and SOAP XML responses back to JSON.

Can only be used within an api, and only one wsdl2openapi is allowed per API: it owns the paths and the generated OpenAPI document of the API it is placed in. To expose several WSDLs, declare one API per WSDL.

The generated OpenAPI document's title is the enclosing api's name.

Errors are returned as problem details documents (RFC 7807). An error the service reports becomes a 500, and the content of an error the WSDL declares appears under details, keyed by the name of the declared error. Errors the gateway itself detects carry the status that fits them, such as 400 for a request it cannot map or 405 for a method the path does not support. Nothing in the response reveals that a SOAP service is being called.

Example Configuration

api:
name: Purchasing API
port: 2000
path: /purchasing
flow:
- wsdl2openapi:
wsdl: http://backend-service/service.wsdl
description: Look up and create purchase orders.
operations:
getAll:
method: GET
path: articles
createOrder:
method: POST
path: orders
api:
   name: Purchasing API
   port: 2000
   path: /purchasing
   flow:
     - wsdl2openapi:
         wsdl: http://backend-service/service.wsdl
         description: Look up and create purchase orders.
         operations:
           getAll:
             method: GET
             path: articles
           createOrder:
             method: POST
             path: orders

Syntax

wsdl2openapi:
wsdl: <string> # required
description: <string>
operations:
<operation>:
'$ref': <string>
flow:
- <flow>
method: <string>
path: <string>
tag: <string>
version: <string>
wsdl2openapi:
  wsdl: <string> # required
  description: <string>
  operations:
    <operation>:
      '$ref': <string>
      flow:
        - <flow>
      method: <string>
      path: <string>
      tag: <string>
  version: <string>

Attributes

NameRequiredDefaultDescriptionExamples
descriptionfalse-API-level description, shown above the auto-generated note about how this OpenAPI document was produced.Look up partner records by ID.
versionfalse1.0.0Version of the generated OpenAPI document.2.1.0
wsdltrue-The WSDL (URL or file).http://backend-service/service.wsdl

Child Structure

ElementCardinalityDescription
operations0..1Named map of WSDL operations to expose via OpenAPI

Can be used in