Troubleshooting no matching REST operation

Understanding how the GWS finds an operation to use for a request can help in troubleshooting unexpected errors.

A common error you may encounter is that caused by the GWS not being able to find a matching operation for a request. An unsupported MIME type or other issue may cause this.

Criteria for REST operation search

The GWS scans the list of operations of a REST service for 4 criteria to find a match for the function to use for a request:
  • HTTP PATH
  • HTTP VERB
  • HTTP Content-Type header (if any) - corresponding to the WSMedia set for the input parameter of the operation
  • HTTP Accept header (if any) - corresponding to the WSMedia set for the return parameter of the operation
Important: All 4 criteria (including the HTTP headers if specified) are required to match the operation.
For example, your request to get a list of customers might specify the media type of the response as XML. However, using the equivalent to this curl command, the request fails:
curl -H "Accept: application/xml" http://localhost:8090/ws/r/MyService/customers
The GWS returns this error:
"400 No matching Rest operation found"
Assuming in this case the path (/customers) and verb (GET) is ok, the GWS did not find a match to any operation because the operation's output type does not support XML. With reference to the curl command above, try the request without specifying the media type of the response to get the default output:
curl http://localhost:8090/ws/r/MyService/customers
It is recommended that you refer to the OpenAPI specification for the Web service for details of the operations supported media types.