Thursday, March 12, 2015

Web services - Part3

Types of Web services

Web services can be classified as “Big” web services and “RESTful” web services. Big web services are based on SOAP standard.RESTful web services are based on how web behaves.
The “Big” Web services technology stack (SOAP, WSDL, WSSecurity,etc.)delivers interoperability for both the Remote Procedure Call (RPC) and messaging integration styles.RESTful Web services is an alternative solution to implement remote procedure calls across the Web

'BIG' Web services key points:

-Big web services use XML messages that follow the Simple Object Access Protocol (SOAP) standard, an XML language defining a message architecture and message formats.

- A SOAP-based design must include the following elements :

  • WSDL can be used to describe the details of the contract, which may include messages, operations, bindings, and the location of the web service. You may also process SOAP messages in a JAX-WS service without publishing a WSDL.
  • It Should also address complex nonfunctional requirements like transactions, security, addressing, coordination etc.
  • The architecture needs to handle asynchronous processing and invocation.


- SOAP integrates between client and server using WSDL.Web Services Description Language (WSDL) is an XML language for defining interfaces syntactically.XML Schema is used to describe the structure of the SOAP message.

- SOAP is an XML language defining a message architecture and message formats, hence providing a rudimentary processing protocol. The SOAP document defines a toplevel XML element called envelope, which contains a header and a body. The SOAP header  can be used for routing purposes (e.g., addressing) and Quality of Service (QoS) configuration (e.g., transactions, security, reliability).

- Using SOAP, the same message in the same format can be transported across a variety of middleware systems, which may rely on HTTP

- SOAP security is well standardized through WS-SECURITY.


REpresentational State Transfer (REST)  key points:

- The motivation behind the development of REST was to create a design pattern for how the Web should work, so that it could act as a guiding framework for the Web standards and designing Web services. REST itself is not a standard but it prescribes the use of standards such as HTTP, URL, and XML/HTML/JPEG

- The term “REST” was given by Roy Fielding.
“Representational State Transfer is intended to evoke an image of how a well-designed Web application behaves: a network of web pages (a virtual state-machine), where the user progresses through an application by selecting links (state transitions), resulting in the next page (representing the next state of the application) being transferred to the user and rendered for their use.”  – Roy Fielding

- In the web, everything is identified by resources. When we type a URL in the browser we are actually requesting a resource present on the server. A representation of the resource (normally a page) is returned to the user which depicts the state of the application. On clicking any other link, the application transfers state with the new representation of the resource. Hence the name Representational State Transfer.

- REST-style architectures consist of clients and servers. Clients initiate requests to servers who process these requests and return responses based on these requests.These requests and responses are built around the transfer of representations of these resources.Fundamentally in REST each resource is first identified using a URL and a new resource for every service required is created.

- When using REST over HTTP, it will utilize the features available in HTTP such as caching, security in terms of TLS and authentication

- Two simples security is provided on the HTTP protocol layer such as basic authentication and communication encryption through TLS

REST architectural style describes six constraints applied to architecture:

1. Uniform Interface - Individual resources are identified using URLS.The client can manipulate the resource through the representations provided they have the permissions.A representation of a resource is a document that captures the intended state of a resource.

2. Stateless Interactions - none of the clients context is to be stored on the server side between the request. All of the information necessary to service the request is contained in the URL, query parameters, body or headers.

3. Cacheable - Clients can cache the responses.

4. Client-Server - The clients and the server are separated from each other thus the client is not concerned with the data storage thus the portability of the client code is improved while on the server side the server is not concerned with the client interference thus the server is simpler and easy to scale.

5. Layered System - At any time client cannot tell if it is connected to the end server or to an intermediate. The  intermediate layer helps to enforce the security policies and improve the system scalability by enabling load-balancing

6. Code on Demand - an optional constraint where the server temporarily extends the functionality of a client by the transfer of executable code.


In next blog we will see an example of SOAP implementation.


Web services standards                                                            Creating SOAP Web Service >        

No comments:

Total Pageviews