Web services#
What are web services?#
A web service is a software function that is hosted at a network addressable location. IBM
Distributed systems rely on web services.
What they solve?#
Web services attempt to solve some of the problems presented by other distributed systems development technologies:
- Complexity: High learning curve.
- Solution: Web services are easy to learn.
- Interoperability: Different implementation languages.
- Solution: Web services are platform-independent.
- Firewall: Need to configure the non-standard ports to be used.
- Solution: Web services use only standard ports, because they use HTTP (port 80) or HTTPS (port 443) protocol, which are standard ports.
Architecture#
Web services follows Client-Server pattern.
Views#
Conceptual#
- Software component accesible through network.
- Both clients and services send requests and responses—respectively—via messages.
- They make no assumptions about the technological characteristics of the receiver.
Technological#
They are two main approaches:
- SOAP service: Offers an arbitrary set of operations. (Complex)
- REST service: Manipulate representations of web resources using a uniform set of stateless operations. (Simple)
SOAP vs. REST#
SOAP#
SOAP is a protocol for information exchange in a decentralized and distributed environment.
Defines a message architecture and its formats in XML. The language is WSDL.
WSDL#
- XML format for interface operations, parameters, messages and response type.
- Contract between the server and the client: what should the request and response messages contain.
- Declare where the service is.
- What protocol will be used.
WSDL examples here.
REST#
REST services are viewed as resources and may be invoked with an URI.
Consider HTTP not only as a transport protocol, but also as an API.
More about REST here.