Shell Scott
Shell Scott

Reputation: 1909

How to understand that SOAP webservice use HTTP only for transport?

As I understand RESTful webservices use whole power of http, suffice to say all that rest need is http, but in the same time rest!=http. CRUD provides ability to do any action with API resourses, for example we send http request, this request has header for aunthefication, name of method (for example put), and json in body for updating. How this proces is running via SOAP? SOAP uses XML, but how this XML is delivered to API?

Upvotes: 2

Views: 890

Answers (1)

Plamen G
Plamen G

Reputation: 4759

SOAP is based on XML and it conveys that messages are delivered in a SOAP envelope that has a header and a body.

SOAP envelope

When a SOAP message (be it a request or response) is delivered over HTTP you will have the whole envelope put in the HTTP body.

enter image description here

If the implementation is proper, in the HTTP header, in Content-Type you will have application/soap+xml.

Also in SOAP 1.1 you might have the SOAPAction header, which is not mandatory and is discussed in detail in this article.

See this article for sample raw SOAP request and response. Here is an intro to SOAP that you might also find helpful.

Hope this helps! Good luck.

Upvotes: 2

Related Questions