Docs
Plugin HubOverview

soap

The soap plugin converts JSON requests into SOAP operations defined by a Web Services Description Language (WSDL) document. It also converts the SOAP response into JSON before returning it to the client.

The plugin delegates WSDL parsing and protocol conversion to soap-proxy, which must be reachable from every gateway instance.

Examples

The following workflow starts the SOAP proxy, configures its gateway endpoint, and invokes a public SOAP operation through API7 Gateway.

Set Up SOAP Proxy

Choose the setup that matches the gateway deployment.

Set GATEWAY_CONTAINER to the running API7 Gateway container. Create a dedicated network and connect the gateway to it:

export GATEWAY_CONTAINER=replace-with-gateway-container-name

docker network create gateway-soap-net
docker network connect gateway-soap-net "$GATEWAY_CONTAINER"

Start the SOAP proxy on the shared network with the image used by the current API7 Gateway chart:

docker run -d \
  --name soap-proxy \
  --network gateway-soap-net \
  api7/soap-proxy:1.0.0

Add the SOAP proxy endpoint to the persistent config.yaml used by the gateway deployment:

config.yaml
plugin_attr:
  soap:
    endpoint: http://soap-proxy:5000
    timeout: 3000

Reload the gateway after updating its configuration source:

docker exec "$GATEWAY_CONTAINER" apisix reload

Invoke a SOAP Operation

Create a route that maps POST /SayHello to the SayHello operation in the WSDL document:

curl "http://127.0.0.1:9180/apisix/admin/routes/soap-hello" -X PUT \
  -H "X-API-KEY: ${ADMIN_API_KEY}" \
  -d '{
    "uri": "/SayHello",
    "methods": ["POST"],
    "plugins": {
      "soap": {
        "wsdl_url": "https://apps.learnwebservices.com/services/hello?wsdl"
      }
    }
  }'

The request path identifies the WSDL operation, and wsdl_url identifies the service contract and upstream SOAP endpoint.

Send a JSON request to the route:

curl -i "http://127.0.0.1:9080/SayHello" \
  -H "Content-Type: application/json" \
  -d '{"Name": "John Doe"}'

API7 Gateway should return HTTP/1.1 200 OK with the following response body:

"Hello John Doe!"