tags:

views:

73

answers:

3

I'm studiyng the SOA concept and found out the techniques (should i call it like that?) SOAP and REST (only these ones). I want to know if there are any other techniques (?) that coexist in this context and what do they represent. are they better in something? does many people use them? etc. thanks (:

+3  A: 

First, read this: http://www.soaspecs.com/ws.php.

Then read this: http://en.wikipedia.org/wiki/Web_service

Ultimately, everything sits squarely on HTTP. That's the core protocol. What you're asking about is at least two different things. The encoding of document (or arguments) in XML, JSON or something else. The semantics of what's transferred: unconstrained or constrained by HTTP.

XMLRPC - http://en.wikipedia.org/wiki/XML-RPC. This evolved into SOAP. The message is in XML. The semantics are a function call. The message includes the method and the arguments.

SOAP - http://en.wikipedia.org/wiki/SOAP. The message is encoded in XML. It is similar to XMLRPC, with more options, more complex XML and formal WSDL descriptions. http://en.wikipedia.org/wiki/Web_Services_Description_Language

If you use JSON instead of XML, there's no good name for it. It's WS or REST with JSON. It's only SOAP if it uses XML.

There are two general kind of architectures. The SOAP-style request where any verb could be defined in the request, vs. REST where there are just four verbs: POST, GET, UPDATE, DELETE and they're the method portion of the HTTP request.

REST - http://en.wikipedia.org/wiki/Representational_State_Transfer. You can use any message encoding with REST. Some folks use XML, some folks use JSON or YAML. You can easily invent other representations beyond XML and JSON/YAML. However, you are constrained to use the four canonical verbs.

S.Lott
+3  A: 

Its important to separate SOA the architecture from SOAP , REST and other implementations of the architecture.

You can implement a SOA architecture on top of any technoligy that supports request and response via messages.

The core characteristic of a SOA architecture are:-

  • Clients send simple request messages.
  • Server repsponds with single reply messages.
  • Service interfaces are well defined and "advertised" to clients. i.e. CLients can query the server on what services are suppoted and what the interface for these services are.
  • No replication of data and no local storage. If a client wants to know about a Widget then it queries the Widget service, the client does not retain any of the Widget data. Likewise if a client wants to update a Widget's details it sends an update request to the Widget service.
  • Synchronous, Asynchronous and Batch interfaces are all acceptable.

The key advantages of this as an architecture are:-

  • The only contact between a server and its clients is the "interface". The client has and needs absolutly no knowlege of the servers implementation, likewise the server does not care how a client is implemented.
  • The data is owned and managed by the Service and only the service. This eliminates synchroisation, replication problems, and reduces to almost zero the possibility of double updates.
  • The absolute simplicity of the resulting architecture allows for great flexibility.
  • The absolute simplicity of the resulting architecture makes for very reliable systems.

However as you quite rightly concluded in the real world mostly SOAP and REST are used. When people say SOAP they are usually refering to the WS-* series of standards and protocols -->WSDL (Web Service Definition Language), WSM (Web Service Messaging) , WS-Security etc. etc. which use SOAP as the transport mechanism.

Whereas REST has the virtue of simplicity, and, the WS* is highly complex and more difficult to implement I would recommend the WS* approach for any reasonably large system. The WS* standards support not only simple request/response but also asynchronous messages and transports other than http (JMS, files etc), and, more importantly the WS security standard is well though out and supports secure business to buisness communication.

James Anderson
"I would recommend the WS* approach for any reasonably large system"? Why? Amazon.com users seems to prefer REST. http://www.oreillynet.com/pub/wlg/3005. All of that seems off topic, since the question was on alternatives not recommendations.
S.Lott
WS-* is way overengineered. Having a set of protocols that allows you to do anything at all is a recipe for _adding_ complexity to an already complex system. Exactly opposite to the concept of absolute simplicity you advertise earlier.
Muhammad Alkarouri
_"data is owned and managed by the Service and only the service"_. Can you provide a reference to that point? Seems the exact opposite to _service statelessness_ which is known as a principle of SOA.
Muhammad Alkarouri
Muhammad -- its a core priciple if you have a "Customer Data Service" then thats your source of customer data. You do not store this locally (other than short term chache) and you do not replicate to other DBs.
James Anderson
@Muhammad -- yes there is a lot in the WS* stack but you only use the pieces you require. If you start with REST and you get a new requirment for strong authentication or encryption you are in a hole, with WS you just plug in the extra pieces.
James Anderson
@James: _"REST and you get a new requirment for strong authentication or encryption"_. That's not true. All HTTP security options are still there (HTTP authentication, TLS encryption). [OAuth](http://developers.sun.com/identity/reference/techart/restwebservices.html) has also been used. The WS* stack is built on SOAP which tunnels through HTTP, but if you are ready to use HTTP to the full then all those problems have been solved and the stack is not needed.
Muhammad Alkarouri
@James: I did ask for a _reference_ for the customer data service issue because it seems to me that what you are describing is not the standardised and generic SOA, but the Microsoft ecosystem. I can't say I have come across this core principle anywhere else, and I have done research on SOA along my work in grid computing.
Muhammad Alkarouri
even if it is not strictly right (according to the comments), it helped me the most. so i chose it. the comments were gold to me as well. thanks everyone (:
hugo_leonardo
A: 

if you want to be current with WS standards use WS* stack. -- Jani Syed

Jani Syed