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 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.
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.
A query parameter appears more than once or has no =.
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 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.
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.
soapProxy is reachable from the gateway and describes at least one service with a port.type=) parts, the explorer page cannot display the operations. Use another tool to explore the service.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: trueconfiguration: 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.
Configuration reference:
Tutorials with runnable examples:
Still stuck? See the troubleshooting guide or ask on GitHub Issues. For commercial support, contact info@predic8.de.