Monday 31 March 2014

Web Service Architecture And Life Cycle

Inter-Communication of Software Applications

There are different techniques used for the communication between software applications. These techniques vary from platforms to the technologies used for implementation of software applications, like
        RMI is used for inter-communication for java based software applications
        CORBA
        RPC etc.
          The above techniques and protocols have technology and architectural dependencies for inter-application communication over.
          To overcome the technical, cross platform and architectural issues the concept of WebService is introduced.
Utility Computing
Web Service is based on Utility Computing model


Web Service Conceptual Definitions

Definition: Web Service is a technique (Architectural design and specification) which enables electronic devices (Computing Devices) communication over World Wide Web.                                                                      http://en.wikipedia.org/wiki/Web_service
According to the Utility computing (Cloud computing)
Definition: A software application or component available on web as a service.
According to the W3 Architecture
Definition: A software application identified by URI, whose public interfaces and bindings are defined and described using XML.
        This application can be discovered by other software applications.
        The other software applications can communicate with application (Web Service) according to its defined rules by XML messages over internet protocols.
        According to the W3C
                                                                http://www.w3.org/TR/2002/WD-ws-arch-20021114/#whatisws
Definition: A software application designed for inter-devices communication over internet.
        Web Service has standard interface for communication defined according to the WSDL
        Web Service enables communication through SOAP messages over http with XML serialization 

Web Service Architecture

Definition: Web Service Architecture has three main components. One of them has further two parts.
  1. Service(Software Application)
  2. Service Agency (UDDI)
  3. Service Provider
  4. Service Requester

According to the W3 team Architecture of Web Service has no strict components involved for the success of functionality, but all the members (Architects, Analysts and Developers) were agreed that the Web Service architecture should have following capabilities
        Web Service architecture should be able to exchange messages
        Web Service architecture  should be able to define its description
        Web Service architecture  should be able to publish and discover the web service descriptions

Client Server Paradigm

          Web Service follows the client server architecture. Where service requester acts as client (Web browser or any software application) and the Service provider acts as server.
          For communication any internet protocol can be used like HTTP or SMTP etc but HHTP has become standard

1.    Service (Software Application)

    1. Service is a software application implemented according to the description of WSDL.
    2. Service can be invoked by other software application any time from any where on internet.
    3. Service can be implemented using any technology like JAVA, Python etc.
    4. Service can be deployed on any platform
    5. Service also can act as service requester by using other web services.
    6. Service is accessed by HTTP protocol.
    7. Service can also be accessed by other internet protocols like SMTP but HTTP is used in most of the cases.
    8. Messages are composed and exchanged in XML format

2.    Service Discovery Agency (UDDI)

1.       Service discovery agency is a searchable set of instructions and descriptions those can be searched by any software application on internet
2.       It contains service descriptions and implementation details
3.       It contains the metadata about service like
4.       Data types
5.       MIME types
6.       Operations
7.       Binding Information
8.       Network address
9.       It may be centralized or distributed
10.   It works for both providers and requestors
11.   Requestors can use discovery agency to find the descriptions and address of the services
12.   Providers can use the discovery agency to publish the address and descriptions of the services
13.   Requestor/Provider can also be used as UDDI

3.    Service Requestor (Client)

Business definition: A business that requires certain function to be satisfied
Technical Definition: Service Requestor is software application which requests the required
function (service) from service provider
  1. Service Requestor may be a whole application or a component of the application
  2. Requestor may be a http browser or any software application

How Service Requestor works

          The requestor first of all find the description, location and binding details from discovery registry and then interact with service provider.
          Here are two main operations those are done by Service Requestor
1.       Find:
        In the find operation, the service requestor retrieves a service description directly from provider or queries the discovery registry for the type of service required.
        The find operation can be done on two phases
        To retrieve the service's interface description for program development at design phase
        To retrieve the service's binding and location description for invocation at run time.
2.       Interact:
        After getting the address, description and binding details of services the requestor invokes the service through binding details

4.    Service Provider (Software Application)

According to the architect group who defined the web services ‘Service Provider’ is a server who provides the environment to execute the service ‘Web service application’.
Service provider provides the whole mechanism to run the web service application and to access it from remote side on www.

How Service Provider publish services

          For any web service is necessary that it is accessible over the internet.
          No service can be accessed while it is not discovered.
          For service discovery, it is necessary that is published first.
          Service provider publish the following details (Metadata) about the hosted service for discovery
        Description about service
        Data types
        Used functions
        Proposed functions
        Location
        Provide/Consumer MIME types
        Bindings
          The above explained details are published in WSDL (XML) document
          The service requester can find the WSDL (XML) document from discovery registry and can communicate with provider

How Web Service Works?

       First of all Service Requestor (Web browser, Software application) finds the metadata (Description, location, binding, functions) from discovery registry in WSDL (XML) document form.
       Note: Requestor can also find these information directly from its own directory like if the same service is requested earlier
       After finding the WSDL document the requestor composes the SOAP message in XML format and sends it to the service provider through http protocol
       After receiving http request the server composes the response message (SOAP message) according the WSDL specifications and send it to the requested client.
       The server sends back the response message if requester has requested the response else server does not send response

Rest Oriented Framework Architecture Diagram

Architectural Diagram


Description of Diagram

Client(browser/server/application) sends the request to the server for specific resource.
Web server (Main controller) receives the request from client and starts to process.
Controller forwards the request to action controller which do the authentications and in success it forwards the request to the REST API otherwise sends back the response to client
         1.When server identifies that the request is for RESTFul resource then it forwards to RestAPI
2.RestAPI implementations first of all reads the URI mappings for resource
3.Identifies the type of the request and forwards the request to RESTFul service fro specific           resource
4.Uniform interface of the RESTFul service receives the request and serves it by specific representation of the resource. Here resource state and representation is described in following steps
5.N number of resources can be available at a time
6.Resource can have more than one representations at a time
7. Representation of resource are maintained through the ORM API
8. ORM API communicates with framework to solve the OOD relationships of any resource
9. ORM also communicates with rest of frame also to solve the dependencies
              1.ORM also communicates with storage servers to update the state of the resources
10. RESTFul service sends back the response to the server controller which sends back the result to the clients.