Soap web services and ReST web services

    Soap webservices are webserivces which use soap protocol [no longer simple object access protocol.. it is so complicated now]. ReST stands for Representable State Transfer web services.  ReST web services use normal HTTP protocol. These are simple and represented in HTTP URLs. These do not depend any common definition language like wsdl. Definition language/output schema is given by service provider. In ReST web services, we access a web page and get XML output [mostly xml output .. we can get output in other formats also. this depends on service provider] instead of HTML. XML output schema is specified by the service provider. Now a days, many internet companies like yahoo, amazon are giving their apis based on ReST instead of traditional soap services. For accessing these from programs, we just have to have xml apis for parsing xml output from the services. If our webservices do not need any state, we can implement them using ReST which aligns well with HTTP protocol [ stateless protocol]. We can also implement stateful services also using ReST.

If we want security, transaction support in our services, it is better to implement them in soap services only.. because there are lot of specifications/apis for doing that. You might have heard JAX-* apis for web services. All of those are for soap web services [although JAX-WS 2.0 says that it supports ReST also].

For services used in AJAX, ReST services fit well. ReST service messages are shorter than soap service messages because soap services use lot of XML [soap itself is represented in XML]. Recently I read in some article that, ReST services use very less amount of memory because XML demarshalising is very little when compared to soap. So, ReST services are good for low memory devices also.


1 Comment

  1. tombarta said,

    August 6, 2008 at 6:11 am

    One major distinction between SOAP and REST is that SOAP is a fully-specified transport-agnostic protocol (you can layer SOAP on top of SMTP, for example). Someone can implement a SOAP service and the work is done – clients can connect automatically. SOAP dictates a mapping between XML messages and language-dependent object/method invocations.

    REST,on the other hand, is a pattern describing the semantics of URLs and expected usage of HTTP methods. There isn’t a single “REST” standard that can be implemented. Rather, web service providers specify their own protocol for marshalling and interpretation (typically using XML, though that’s not required). In fact, every well-done website should itself be a RESTful web service – receiving querystring-encoded input (either as part of the URL itself or via a POSTed payload) and publishing X?HTML output.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: