Open Source API Gateway
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.

An API exposes a single port of a single service of the WSDL. To expose several services of one WSDL, declare one API per service.

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.

See tutorials/wsdl-to-openapi/10-WSDL-to-OpenAPI.yaml.

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>
status: <int>
tag: <string>
port: <string>
service: <string>
version: <string>
wsdl2openapi:
  wsdl: <string> # required
  description: <string>
  operations:
    <operation>:
      '$ref': <string>
      flow:
        - <flow>
      method: <string>
      path: <string>
      status: <int>
      tag: <string>
  port: <string>
  service: <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.
portfalse-The port of the service to expose; it decides the operations, the SOAP version and the address that is called. Required when the SOAP ports of the service implement different port types. Otherwise the SOAP 1.1 port is used, or the SOAP 1.2 port when there is none. A port that is not bound to SOAP over HTTP cannot be selected.OrderServiceSoap12
servicefalse-The WSDL service to expose. Required when the WSDL declares more than one service; with a single service, that one is used.OrderService
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