Web Services by durgasoft

 Session 1:(Introduction)

  • Web Service is not an api it is a specification which contains rules for establishing communication between 2 interoperable applications
  • Before web services we have:
                   1.Socket Programming
                   2.Remote Method Invocation(RMI)
                   3.EJB(Enterprise Java Beans)
                   4.CORBA(Common Object Request Broker Architecture)
  • ATM example, If we want to withdraw money using SBI Atm card from ICICI Bank ATM, then customer details are valid or not and other information of sbi cusomer is checked by ICICI ATM  using web services.

Session 2:(Web Services Architecture)


Main Components of web services Architecture:
1.Skeleton(Pre defined class)
2.Wsdl generation ool(Pre defined class)
3.UDDI registry
4.Stub Generation tools(Pre defined class)
5.Soap request
6.HTTP protocol

Flow of request and response:
  1. Service provider will create set of web services in any language.
  2. Service Provider will create WSDL(Web Services Description Language) xml files(one for each service) which specifies the information of services provided.
  3. It also has Skeleton(Single for all services) class, whose responsibilty is to create application specific objects from the request received from client i.e if service provider uses Java language and the consumer or client is using C++ language then the request received from the client will be able to talk to service provider using skeleton.
  4. Web service configuration file, It is responsible for mapping request to corresponding service classes from the service provider end.
  5. The WSDL xml files generated by service provider, can be hosted in UDDI(Universal Description, Discovery  and Integartion) so that it can be available to all the consumers who needs it.
  6. We can send the wsdl files to selected customers via mail
  7. Stub Generation tools or Proxy Gen tools are responsible for converting wsdl files into stubs or proxies.
  8. Stubs or proxies are client specfic language classes corresponding to services classes i.e if a service provider uses java and client uses C++, then stubs are actual service classes which were written in java in service provider end got converted o C++ classes.
  9. The client application invokes service methods and  it needs to get the results dynamically.So the stubs(C++ classes here) are responsible for creating a XML request.
  10. The xml request uses SOAP tags, so it is called soap request which contains details of method name,parameters etc over http, the request will go to service provider end.
  11. In the service provider end, skeleton will be responsible for processing the request, generally skeleton will be inside web.xml file.
  12. Skeleton receives soap request and it will map the request to the corresponding service class by using web service configuration file(It contains all service names mapped with actual classes location)
  13. The xml response will be sent to client over http using soap response
Note:As web services are only specifications or rules of how communication can be established between applications over http, it does not provide any implementation or API's.All the pre defined classes were given by the ones who will provide implementation or API's.

Session 3:(Java Web Service API's)

  • Sun has provided total 4 API's to develop web services
  1. JAX-RPC(Java API for XML - Remote Procedure call)
  2. JAX-M(Java API for XML - Messaging)
  3. JAX-WS(Java API for XML - Web Services)
  4. JAX-RS(Java API for XML - Restful Services)
  • There are 2 types of web services 
  1. Synchronse web services 
  2. Asynchronse web services
---------------------------------------------------------------------------------------------------------------------------
Synchronse web services:    
  • whenever client makes a request to service and if service provides response immediately, then we call it a synchronoous web service
  • To develop synchronous web services we use below API's
  1. JAX-RPC
  2. JAX-WS
  3. JAX-RS
 Asynchronse web services:    
  • whenever client makes a request to service and if service provider takes some time to respond, then we call it a synchronoous web service
  • To develop asynchronous web services we use JAX-M
--------------------------------------------------------------------------------------------------------------------------
  • Again synchronous web services are divided into 2 types i.e:
  1. Soap based web services 
  2. Restful web services
  • To develop soap based web services we use JAX-RPC(Legacy before java 1.4) and JAX-WS
  • To develop restful web services we use JAX-RS
  • Unfortunately all API's are spefications but no implementations
  • so every spefication needs implementations to develop web servicesor web clients
  • lot of third party vendors provided implementations for above specifications
--------------------------------------------------------------------------------------------------------------------------
JAX-RPC:
  • JAX-RPC-SI:(Sun Implementation) given by sun
  • Axis 1 Given by Apache
  • weblogic implentation - Its came alonmg with web logic server
  • websphere implentation - Its came alonmg with web sphere server
  • JBoss implentation - Its came along with JBoss Server(Redhat)
Note:JAX-RPC-SI and Axis 1 are container independent implementations and rest all are container dependent
-----------------------------------------------------------------------------------------------------------------------------
JAX-WS:
  • JAX-WS-RI(Reference Implementation) ->Sun (JDK 1.6)(It onlyprovides blueprint)
  • Metro -> Sun
  • Axis2 -> Apache foundaion(Does not support spring)
  • Apache XCF -> Apache Foundation(Supports spring)

  • Weblogic Implementation -> BEA
  • WebSphere Implementation -> REDHAT
  • JBOSS Implementation -> IBM
  • Glass Fish Implemenattion -> SUN
----------------------------------------------------------------------------------------------------------------------------
JAX-RS:
  • Jersy -> SUN
  • Resteasy -> RedHat
  • Restlet -> Jerome Louvel
  • Apache wink -> Apache foundation
  • Apache CXF -> Apache foundation

Session 4:(Axis 1 Implementation):


Session 5:(JAX-WS-RI Implementation):








Comments