roast_soul
roast_soul

Reputation: 3640

Is calling a SOAP webservice like calling a RESTful one?

Calling a RESTful web service means POST/GET some values to the web service URL.

When calling a SOAP web service, does it also POST the value to the web service URL (with the value following the SOAP format)?

Or another way of putting this, calling SOAP web services and RESTful web services makes no difference except for the data format?

Upvotes: 1

Views: 58

Answers (1)

Bogdan
Bogdan

Reputation: 24580

There are a lot of differences between SOAP and REST. I won't go into details because you'll find lots of information online, but regarding the requests you send to the services I can mention a few difference of the top of my head:

  • assuming the main protocol used by both (i.e. HTTP), SOAP uses only POST for all of it's messages while REST can use all the verbs (GET, POST, PUT, DELETE, HEAD etc);
  • SOAP defines operations to be performed (you can create an unlimited number of operations inside the message payload: getCustomer, deleteCustomer, createOrder, updateDetails, etc) while REST uses only the operations provided by HTTP (GET, POST, PUT etc);
  • SOAP operations don't care about the operation of the underlying protocol (everything is on top of POST) so the meaning of the operation is within the SOAP payload itself. REST does care about the meaning of the underlying protocol operation and it must respect it. You can't DELETE a resource by performing a GET, for example.
  • SOAP only exposes one endpoint for all of it's operations. The operation name is inside the payload as well as specifying the entity on which you are doing that operation on. REST exposes lots of endpoints, one or many for each resource (e.g. /customers, /customers/12, /customers/12/orders, /customer/12/orders/last etc).

So, in conclusion, calling a SOAP web service is actually different than calling a RESTful one.

Upvotes: 1

Related Questions