Sunday, December 8, 2013

Java WebServices

                                     Learning Steps for Java Webservices

1. Learn XML
2. Learn about  DTD and Schema
3. Learn xml namespace
4. XML Parsing in Java
     a. JAX -P
     b. JAX-B
5. JAXP ( Java API for XML Parsing)
   a. DOM
   b. SAX
6. JAXB (Java Architecture for XML Binding)
   XSD is converted to class using XJC
7. Web Services are two types
     a. SOAP Based Webserivces
     b. RESTFUL Webserivces
8. SOAP Webservices we have two types
     a. JAX-RPC
     b. JAX-WS
9. Restful Webservices we have only one type
     a. JAX-RS
10. JAX-RPC
     a. Support SOAP 1.0 and WSLD 1.1
     b. BP1.0 specification
     c. SAAJ will be used for attach a  file
     d. Asynchronous not supported
     e. JDK1.4.0 on wards we have support
     f. Default Message Exchange Format (MEF) is JAX-RPC Encode
11. JAX-WS
    a. Supports SOAP 1.0 & SOAP 1.1 , WSDL 1.1 & WSDL 1.2
    b. BP 1.1 specification
    c. MTOM will be used for attach a file
    d. ASynchronous is supported.
    e. JDK 1.5 onwards we have support
    f. No Default Message Exchange Format (MEF)
    g. JAX-B is the default parsing used
12. JAX-RS
   a. No xml is used for request and response
   b. Using URI we will be using the webservices
13. Development Steps for SOAP based Webservices
     a. Need to choose JAX-RPC or JAX-WS
     b. Approach should be
         i. Top to Bottom  or Contact First (WSDL to Java)
         ii. Bottom to Top or Contract Last ( Java to WSDL)
     c. End point : These are listeners for the request send by consumer
          i. Servlet End point
         ii. EJB End point
     d. Message Exchange Pattern (MEP)
          i. Synchronous
         ii. Asychronous
        iii. Fire & Forgot
    e. Message Exchange Format (MEF)
         i. RPC - Encoded
        ii. RPC - literal
       iii. Document - Encoded
       iv. Document - Literal
14. JAX-RPC development
      a. Create a interface which extends Remote interface and this interface is known as Service Endpoint Interface (SEI)
      b. Methods declared in interface will be exposed.
      c. Exposing methods should throw RemoteException
      d. Input and Output needs to be serializable objects
      e. All methods must be public
15. JAX-WS development steps
     a. Interface should have annotation as @WEBSERVICE and class also
     b. Method which needs to be excepted then it should have an annotation as @WEBMETHOD
     c. Method should throw WebserviceException
     d. Method should be public and it should not be final.
16. WSDL
       <definition>
            <types>
            <messages> ( 0 or n)
            <porttype> <operation /> </porttype>
            <binding>
            <service> <port> </service>
        </definition>
  WSDL file which should read from bottom to up.
  

     http://javatutorialguide.com/web-services/tutorial/different-types-of-webservices-in-java.php#


No comments:

Post a Comment