In a REST API, certain extra information in the response is placed in the HTTP headers. For example, when the API has a rate limit, the response could have X-RateLimit-Limit in the headers. This is very straight forward.

However, what would be the equivalence of or the convention for doing the same thing in a SOAP 1.1/1.2 web service API?

Using the same example with X-RateLimit-Limit, should the information just be added to the HTTP headers of the SOAP response just like in a REST API too?

1 Answers

0
Red Boy On

There is no clear guidelines defined related to rate-limits as far as SOAP1.1 / SOAP1.2 are conncerned.

The SOAP headers contain application specific information related to the SOAP message. They typically contain routing information, authentication information, transaction semantics etc. These are specific to the SOAP message and are independent of the transport that SOAP uses (in the scope of this post: HTTP).

HTTP headers define the operating parameters of the HTTP transaction, like the content type of what's getting transmitted, the content length of it, cache directives for clients or proxies etc. These are specific to HTTP and are independent on what actually gets transmitted with HTTP (in this case the SOAP XML).

Using the same example with X-RateLimit-Limit, should the information just be added to the HTTP headers of the SOAP response just like in a REST API too?

HTTP headers usually stop at the web server, and shouldn't go to Application, and if we apply this logic, then we could conclude, that rate-limit is something should be handled by web-server or API gateway rather then application. Also, rate-limit is something should be dealt same way for SOAP AND REST services rather then differently. Like content-type, content-length, encoding etc are usually HTTP headers, not SOAP Headers.

Hence, x-rate-limits should be part of HTTP header.

I would like to give an example of same HTTP header from Docusign SOAP service and it sends the X-rate-limit headers in HTTP Header.

I don't think, this question could have very clear answer, but I hope, I covered some pointers that could help others.