Java Web Services - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Java Web Services

Description:

Java API for XML-based RPC (JAX-RPC) 10/8/09 ... JAX-RPC API for XML based RPC. RPC-based Web service is a collection of procedures that can be called by a ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 20
Provided by: itIi
Category:
Tags: java | services | web | xmlbased

less

Transcript and Presenter's Notes

Title: Java Web Services


1
Java Web Services
  • Rajkumar Sen
  • 02305035

2
Outline
  • Why Java Web Services
  • Java Web Services Developer Pack
  • A Simple Web Service scenario
  • APIs provided in JWSDP
  • Remaining promises
  • Conclusion
  • References

3
Why Java Web Services
  • Ability of enterprises using different computing
    platforms to communicate with each other
  • Java ensures code portability
  • J2EE ensures scalability
  • APIs hide all the implementation details
  • Components are reusable
  • Development time is substantially reduced

4
Java Web Service Developer Pack
  • Free integrated toolkit that allows Java
    developers to build, test and deploy Web services
  • Web services standards WSDL, SOAP, UDDI
  • APIs provided
  • Java API for XML Messaging (JAXM)
  • Java API for XML Registries (JAXR)
    Java API for XML-based RPC (JAX-RPC)

5
Sample Scenario-Online Book store
Book Distributor Web Service
Request prices Order books JAXM/JAX-RPC
Book Store Client
Book Store Server
HTTP
Book Distributor Web Service
JAXR Register Service
JAXR Find service
Registry Server
6
JAX-RPC API for XML based RPC
  • RPC-based Web service is a collection of
    procedures that can be called by a remote client
    e.g.. A stock quote service
  • Ties, the low-level classes that the server needs
    to communicate with a remote client
  • WSDL document used for creating stubs, the
    low-level classes that are needed by a client to
    communicate with a remote service.
  • Stubs can be static or dynamic.
  • Tools wscompile and wsdeploy simplify our job

7
JAX-RPC Contd.
  • Service consists of
  • Interface
  • Declares the
    service's remote procedures
  • Implementation class
  • Implements the
    remote procedures.
  • Configuration files jaxrpc-ri.xml and
    web.xml contain all the parameters needed to
    deploy the service.
  • Client is a Java program which uses the stubs
    created from the WSDL document of the service
  • Configuration file config.xml contains the
    location of the WSDL document.

8
JAX-RPC Contd.
  • Service Interface
  • public interface BookIF
  • public Book getPriceList()
  • public String orderBook(String BookName,
    int quantity)
  • Implementation class
  • public class BookImpl implements BookIF
  • public Book getPriceList() . . .
  • public String orderBook(String BookName,
    int quantity) . . .

9
JAX-RPC Contd.
  • Client code
  • public class BookClient
  • public static void main(String args)
  • BookIF BookOrder new
    BookServiceImpl().getBookIF()
  • Book priceList BookOrder.getPriceLi
    st()
  • for (int i 0 i lt priceList.length
    i)

10
JAXM API for XML Messaging
  • Provides a standard way to send XML documents
    over the Internet
  • Based on SOAP and SOAP with Attachments
    specifications
  • Messaging provider service, which does the
    behind-the-scenes work required to transport and
    route messages
  • Standalone client also possible for
    request-response type of messaging
  • Very useful when Enterprise work on shared
    schemas.(e.g.. Schema for order form in Online
    Book Store)

11
JAXM Contd.
  • Advantages over JAX-RPC
  • One-way (asynchronous) messaging
  • Routing of a message to more than one party
  • Reliable messaging with guaranteed delivery
  • Steps
  • 1.Setting up Connection with the end-point.
  • 2.Creating the SOAP message and populate it.
  • 3.Sending the message.

12
JAXR API for XML Registries
  • Provides a convenient way to
  • access standard business registries
  • Supports two standards ebXML and UDDI
  • Standards groups have developed
  • schemas for particular kinds of XML documents,
    and two businesses might for example, agree to
    use the schema which is stored in the registry.

13
JAXR Contd.
  • Querying a registry-Useful methods
  • 1.findOrganizations
  • which returns a list of organizations
    that meet the specified criteria
  • 2.findServices
  • which returns a set of services offered
    by a specified organization
  • 3. findServiceBindings
  • which returns the service bindings
    (information about how to access the service)
    that are supported by a specified service
  • Similar methods exist for Managing Registry Data.

14
Remaining Promises
  • Security provided in JWSDP
  • Features yet to be supported in JWSDP
  • Simple Implementation of Sample scenarioOnline
    book store and try to see the issues/problems
    involved.
  • Issues related to Distributed Transaction
    Management.

15
Conclusion
  • Role of Java in Web Services
  • APIs hide most of the implementation details
  • Developer concerned with the logical part of the
    Web Service.
  • However, operability from .NET to J2EE web
    services is unclear. No standards defined.
  • All is not fine
  • e.g. Does not support Distributed
    Transaction processing

16
References
  • 1.The Java Web Services Tutorial
  • http//java.sun.com/webservices/docs/1.1/tutorial/
    doc/index.html
  • 2.Java API for XML-RPC web services
  • http//java.sun.com/xml/jaxrpc/index.html
  • 3.Java API for XML Messaging
  • http//java.sun.com/xml/jaxm/index.html
  • 4.Java API for XML Registries
  • http//java.sun.com/xml/jaxr/index.html

17
  • Thank You

18
JAXR Contd.
19
SOAP
Write a Comment
User Comments (0)
About PowerShow.com