Open Source API Gateway

500 Internal Server Error: Web Service Explorer Failed

Membrane API Gateway returns 500 Internal Server Error with the detail Error dispatching request! when the web service explorer of a soapProxy cannot answer a request.

The Error Response

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

What the Web Service Explorer Does

Every soapProxy contains a webServiceExplorer. It answers GET requests that do not ask for the WSDL with an HTML page that describes the service and its operations. See the SOAP tutorial for an example.

Common Causes

The Query String Cannot Be Parsed

A query parameter appears more than once or has no =.

The WSDL Cannot Be Loaded

The WSDL cannot be loaded or parsed at request time. The explorer reads the WSDL again for every request, so a WSDL URL that is temporarily unreachable also triggers this error.

The WSDL Cannot Be Displayed

The WSDL has no service or no port, or an operation uses a message whose part is declared with type= instead of element=, or has no part at all. The explorer cannot render such an operation. The SOAP proxying itself is not affected.

An Unexpected Exception in the Plugin

The same link also appears when the webServiceExplorer plugin throws an exception that it does not turn into an error response itself. Membrane then aborts the exchange with 500 Internal Server Error, and the detail reads Aborting! Exception caused in web-service-explorer during … flow. with the request URI and the flow. Membrane logs every occurrence with the full stack trace. Unless the exception points to your configuration or to the message content, this usually indicates a bug in Membrane.

How to Fix It

  1. Client side: send the request without repeated or malformed query parameters.
  2. Gateway operator: check that the WSDL of the soapProxy is reachable from the gateway and describes at least one service with a port.
  3. For a WSDL with RPC-style (type=) parts, the explorer page cannot display the operations. Use another tool to explore the service.
  4. For any other cause, check the gateway log and report the problem 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 the details and the link to this page are left out. If the response contains a log key, search the gateway log for it to find the full error message.

If the plugin is nested inside a request, response or abort element and fails with an unexpected exception there, 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.