10

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.

Alex T
  • 1,296
  • 2
  • 17
  • 25

1 Answers1

11

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 successful or failed SOAP request. Thus I would use 500 with the error logged in the standard SOAP fault.

xtofl
  • 40,723
  • 12
  • 105
  • 192
Namphibian
  • 12,046
  • 7
  • 46
  • 76
  • Yeah, I would agree with you. The only thing that prevents me from being 100% sure is that phrase "SOAP HTTP follows the semantics of the HTTP Status codes". Let's wait for any other opinions and arguments. – Alex T Aug 24 '18 at 19:37