SOA and Web Services are two buzzwords in the software industry now a days. Most of the people are confused about, What they are?. And they dnt knw the difference, they take them as synonyms. Well I will try to clear the difference between these two.
Before going for the definition of SOA, we should atleast know what actually a service is ?
A Service is a unit of work done by a service provider to achieve desired end results for a service consumer. It represents a publicized package of functionality.
Both service provider and service consumer are the roles played by software agents on behalf of their owner.
A service is :
The actual use of service is often based upon an agreed-upon contract with the provider, including in detail what is provided and what is the quality( availability, cost etc ) of the service.
SOA is an architectural style whose goal is to achieve loose coupling among interacting software agents.
SOA is a specific architectural style that is concerned with loose coupling and dynamic binding between services.
A very good example of SOA, which I went through in one of the tutorial on http://webservices.xml.com is :
Take a CD for instance. If you want to play it, you put your CD into a CD player and the player plays it for you. The CD player offers a CD playing service. Which is nice because you can replace one CD player with another. You can play the same CD on a portable player or on your expensive stereo. They both offer the same CD playing service, but the quality of service is different.
The idea of SOA departs significantly from that of object oriented programming, which strongly suggests that you should bind data and its processing together. So, in object oriented programming style, every CD would come with its own player and they are not supposed to be separated. This sounds odd, but it’s the way we have built many software systems.
On the other hand, Web Services is an approach to realizing a SOA.
The World Wide Web Consortium (W3C), which has managed the evolution of the SOAP and WSDL specifications, defines Web services as follows:
A software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with XML serialization in conjunction with other Web-related standards.
Inspite of explaining each and every concept I will just present the architecture diagrams of the two
Web Services is the base for implementing SOA and the Service bus is the centerpiece of this implementation. So here is the architecture of the Service bus.
Web Services :
The bottom (transport) layer presents its capabilities to cope with various transport protocols to communicate between a service and a requester. In case of web services you can transport messages by using the ubiquitous Web protocols such as HyperText Transport Protocol (HTTP) or Secure HTTP (HTTPS) to give the widest possible coverage in terms of support for the protocols, you can also transport them over any communications protocol.
The messaging layer on top of the transport layer enables the bus to deal with messages, both XML and non-XML. The latter is important, for example, if a requester and the service needed reside in the same J2EE application server and the bus can simply transport the data in its Java rendering, avoiding unnecessary transformations. The messaging services component of the framework contains the most fundamental Web services specifications and technologies, including eXtensible Markup Language (XML), SOAP, and WS-Addressing. Collectively, these specifications form the basis of interoperable messaging between Web services. XML provides the interoperable format to describe message content between Web services and is the basic language in which the Web services specifications are defined.
The next ( description )layer of the bus facilitates and deals with the description of services in terms of functions supported, quality of services of these functions, and supported binding mechanisms. This metadata is important, and it is fundamental to achieving the loose coupling that is associated with an SOA viz. WSDL, WS-Policy
The actual quality of services that the bus enforces based on appropriate parameterization via polices resides in the layer that follows. The specific issues involving this layer include security, reliability of message delivery, and support for transactions. Likewise web Services provides WS-Reliable Messaging, WS-Security.
The top layer represents the various kinds of virtual components that Web services represent. This layer has atomic services that are not composed as far as a requester’s experience with the service is concerned. Composite services that the service bus inherently supports are choreographies and societies of services that cooperate following an agreement protocol to decide on the success of the cooperation at the end of the cooperation.
Finally, another layer provides features for discovery of services and their descriptions and to agree on a mode of interaction between a requester and a service. UDDI and META-DATA Exchange are the ways it is done using web services.