SOA vs Web Services
Web services are used to build applications that can send/receive messages using SOAP over HTTP. A web service is a publicized package of functionality offered over the web. SOA is a set of architectural concepts used for the development and integration of services. Web services can be used to implement SOA. But it is only a single method of realizing SOA based applications.
What are Web Services?
A Web Service is a method of communication over the network. According to W3C, a Web service is a system dedicated for supporting machine-to-machine transactions over a network. It is a Web API described in WSDL (Web Service Description Language), and Web services are usually self-contained and self-describing. Web services can be discovered using UDDI (Universal Description, Discovery and Integration) protocol. By exchanging SOAP (Simple Object Access Protocol) messages typically over HTTP (with XML), other systems can interact with Web services.
Web services are used in number of ways such as RPC (Remote Procedure Calls), SOA (Service Oriented Architecture) and REST (Representational State Transfer). There are two automated design methodologies for developing Web services. The bottom-up approach deals with first creating the classes and then using WSDL generation tools to compose these classes as Web services. The top-down approach deals with defining the WSDL specifications and then using code generation tools to generate the corresponding classes. Web services have two major usages. They can be used as reusable application-components and /or to connect web applications running on different platforms.
What is SOA?
SOA (Service-oriented architecture) is a set of architectural concepts used for the development and integration of services. SOA deals with distributed computing, in which, consumers consume a set of interoperable services. Multiple consumers can consume a single service and vice versa. Therefore, SOA is often used to integrate multiple applications that use different platforms. For SOA to properly operate, services should be loosely coupled with operating systems and the technologies of underlying applications. SOA developers create services using units of functionality, and make them available over the internet. Web services can be used to implement SOA architecture. In that case, web services become the units of functionality of SOA accessible over the internet. Web services can be used by anybody without being concerned about the platforms or the programming languages used for developing them. SOA is directly built upon the principle of service-orientation, which talks about services with simple interface that can be accessed independently by users without worrying about the actual platform implementation of the service.
What is the difference between SOA and Web Services?
There are some key differences between Web services and SOA. Web services define a web technology that can be used to build applications that can send /receive messages using SOPA over HTTP. However, SOA is an architectural model for implementing loosely coupled service based applications. Web services can be used to implement SOA applications. Even though web service approach to SOA has become very popular, it is only a single method of implementing SOA. SOA can be implemented using any other service-based technology (e.g. CORBA and REST).