Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOAP and HTTP response codes

Is SOAP end-point over HTTP expected to return any status code except 200 and 500? I have a SOAP end-point that has some business logic to reject requests when there are too many of them. I wonder what is the correct HTTP response code in this case - 500 or 429? The SOAP specification seems vague to me:

SOAP HTTP follows the semantics of the HTTP Status codes for communicating status information in HTTP. For example, a 2xx status code indicates that the client's request including the SOAP component was successfully received, understood, and accepted etc.

In case of a SOAP error while processing the request, the SOAP HTTP server MUST issue an HTTP 500 "Internal Server Error" response and include a SOAP message in the response containing a SOAP Fault element (see section 4.4) indicating the SOAP processing error.

like image 699
Alex T Avatar asked Aug 21 '18 07:08

Alex T


People also ask

Does SOAP have HTTP status codes?

SOAP HTTP follows the semantics of the HTTP Status codes for communicating status information in HTTP. For example, a 2xx status code indicates that the client's request including the SOAP component was successfully received, understood, and accepted etc. processing error. “

Does SOAP use HTTP methods?

SOAP is actually agnostic of the underlying transport protocol and can be sent over almost any protocol such as HTTP, SMTP, TCP, or JMS. As was already mentioned, the SOAP message itself must be XML-formatted.

What is a SOAP response?

A SOAP response message is sent by the SOAP provisioning client in response to a SOAP request. Each response contains a series of ASCII characters.


1 Answers

In short SOAP uses HTTP/HTTPS as a transport. It is not bound to HTTP/S. SOAP can also use SMTP and JMS as a transport. Yes you can do SOAP via email.

The 200 and 500 error codes mentioned is just the standard way of letting SOAP know that the message contains a successfulll or failed SOAP request. Thus I would use 500 with the error logged in the standard SOAP fault.

like image 172
Namphibian Avatar answered Oct 17 '22 03:10

Namphibian