JHarley1
JHarley1

Reputation: 2112

How can I related Web Services to SOAP and REST

To be honest with you I really don't get the relationship that Web Services share with SOAP and REST.

I have a very simplistic understanding of the whole topic, web services are software designed to facilitate machine-to-machine communication over a network. Web services have an interface that machines understand (WSDL). Other systems interact with a service using SOAP messages.

Where does my understanding of Web Services slip up?

Upvotes: 3

Views: 1404

Answers (2)

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364269

Web services

As you described web services are software for machine-to-machine communication. I would only append that one of the main purpose of web services is interoperability = cross platform communication.

WSDL

WSDL stands for Web Services Description (or Definition) Language. It is XML based language which describes interface (contract) of the service.

SOAP

SOAP stands for Simple Object Access protocol. It is standardized interoperable protocol for machine-to-machine communication. In SOAP service you develop set of methods which allow you to execute code remotely. Only SOAP services can be described by first versions of WSDL. There are multiple types of SOAP web services. Multiple interoperable standards (WS-*) add additional features to SOAP services like message security, distributed transactions, reliable messaging, etc. SOAP can be used over different transport protocols but most common is SOAP over HTTP.

REST

REST stands for Representational Entity State Transfer. REST is not a protocol. It is development approach / philosophy. In REST services you have small set of methods and you use them to work with resources identified by URI. These methods are most commonly HTTP GET, POST, PUT and DELETE. REST services can only be described by WSDL 2.0 (the problem is that WSDL 2.0 is not yet supported by all platforms). Because of different nature of REST services, description is not needed and most of the time not used at all. REST services are used only over HTTP protocol.

Upvotes: 1

whaley
whaley

Reputation: 16265

Very brief attempt at an answer - if this doesn't do it, then please edit your question or comment to clarify what you are looking for.

SOAP is basically a protocol allowing for a platform independent way of performing RPCs or by passing one-way documents (not done nearly as often). It is relatively procedural in nature. You are correct that WSDL is a contract of the interface that the two pieces of software agree to communicate by (I'm careful not to say 'machine' there as you can have SOAP interaction on the same machine too.

REST itself is more of a paradigm on how we are supposed to expose and communicate with 'resources'. I consider it a bit more OO in that everything you are dealing with is a resource (or object) exposed at a specific URL that has the same methods defined on it... the same methods established by the HTTP protocol, which basically amount to a CRUD interface. Though there is no established contract, in the case of a WSDL with SOAP, that doesn't mean that REST 'services' don't have interfaces... they do. They just don't have a uniform way of providing a contract for them (perhaps WADL is becoming widespread enough for this).

If you are curious about REST, I highly recommend giving "RESTful WebServices" by Ruby and Richardson a read.

Upvotes: 2

Related Questions