Open Source API Gateway

500 Internal Server Error: Could Not Process SOAP Request

Membrane API Gateway returns 500 Internal Server Error with the detail Could not process SOAP request! when the sampleSoapService plugin, the built-in demo City service, fails with an unexpected exception. Errors in the SOAP request itself do not lead here, so the cause is a broken installation or a bug in Membrane.

The Error Response

The response contains the status 500 Internal Server Error, the title Internal server error., the detail Could not process SOAP request!, the problem type https://membrane-api.io/problems/internal and a link to this page. In development mode, the exception message is included as well. The type internal means that the gateway could not complete the processing of the exchange. In production mode, the title is replaced by Internal Server Error and the details are left out.

What the Sample SOAP Service Does

The sampleSoapService plugin is a small SOAP service for demos and tutorials, see the SOAP tutorial. It returns information about cities and serves its WSDL for ?wsdl requests. A wrong HTTP method, an unparsable body or an unknown city are answered with a SOAP fault. Only unexpected exceptions end up as this error.

Common Causes

The WSDL Could Not Be Loaded

Membrane could not load or rewrite the bundled WSDL /wsdl/city.wsdl while it answered a ?wsdl request, for example because the resource is missing from the classpath or the XML could not be processed.

An Unexpected Internal State

Processing the request ran into a state the service does not handle. This is rare and usually indicates a bug in Membrane.

An Unexpected Exception in the Plugin

Any other exception that the sampleSoapService plugin does not turn into an error response itself is reported under the same URL by Membrane's generic error handler. The detail then reads Aborting! Exception caused in … flow. and names the plugin, the request URI and the flow. Unless the exception points to your configuration or to the message, this usually indicates a bug in Membrane.

How to Fix It

  1. Check that the Membrane distribution is complete and unmodified. The WSDL is loaded from the Membrane jar.
  2. Look at the exception in the response (development mode) or in the log, and report it with the stack trace on GitHub Issues.

Hide Details in Production

By default, Membrane runs in development mode and adds details to error responses that help you find the problem. These details may reveal information about your setup. In production, turn them off:

configuration:
production: true
configuration:
  production: true

Add the configuration document to your apis.yaml and separate it from the APIs with ---. The title then reads Internal Server Error, and instead of the details the response only contains a log key. Search the gateway log for this key to find the exception.

If the plugin is nested inside a request, response or abort element and throws an unexpected exception, the exception message, the stack trace and the link to this page are currently sent even in production mode. Fix the failing plugin rather than relying on production mode to hide them.

Related Documentation

Configuration reference:

Tutorials with runnable examples:

← All Membrane error messages

Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.