Open Source API Gateway

500 Internal Server Error: Operation Failed

Membrane API Gateway returns 500 Internal Server Error with the title Operation failed when the SOAP service behind a wsdl2openapi API answers with a SOAP fault. The request passed the gateway, and the service reported the failure.

The Error Response

The response contains the status 500 Internal Server Error, the title Operation failed, the detail The service could not complete the operation., the problem type https://membrane-api.io/problems/operation-error and a link to this page. The type operation-error means that the backend service could not carry out the operation.

When the SOAP fault carries a <detail> element, its content is returned in the details field. In development mode, the response also contains the internal faultCode and faultMessage of the fault.

Why the Status Is 500

The wsdl2openapi plugin publishes a SOAP service as a JSON API, see WSDL to OpenAPI. A SOAP fault does not say whether the service rejected the input, failed internally or timed out, so Membrane cannot choose a more specific status and returns 500. Errors during the conversion itself are described under WSDL to OpenAPI conversion failed.

Common Causes

The Service Rejected the Request

The service found the converted request invalid for the operation, for example because of business rules or missing data, and answered with a SOAP 1.1 or 1.2 Fault.

The Service Failed Internally

The service ran into an internal error and reported it as a SOAP fault.

A Fault for a One-Way Operation

If the service answers a one-way operation with a fault body, the fault is reported here instead of an empty success response.

How to Fix It

  1. Client side: if the service reports a problem with the input, check the details field and correct the request.
  2. Gateway operator: in development mode, check the faultCode and faultMessage of the response.
  3. If the service faults on requests it should accept, call the operation directly on the SOAP service to find out whether the service or the JSON to SOAP conversion causes the fault.

Details in Production Mode

By default, Membrane runs in development mode and adds details to error responses. To remove most of them, enable production mode:

configuration:
production: true
configuration:
  production: true

Add the configuration document to your apis.yaml and separate it from the APIs with ---. The title is then replaced by Internal Server Error, and faultCode, faultMessage and the link to this page are left out. The content of the fault's <detail> element is still returned in the details field, so make sure the SOAP service does not put sensitive information there.

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.