Web Services Essentials

Introduction to Web Services

Web services, in the general meaning of the term, are services offered on the Web. In a typical Web services scenario, a business application uses the SOAP protocol over HTTP to send a request to a service at an URL. The service receives the request, processes it, and returns a response. An often-cited example of a Web service is that of a stock quote service, in which the request asks for the current price of a specified stock and the response returns the stock price. This is one of the simplest forms of a Web service: The request is fulfilled almost immediately; the request and response are parts of the same method call.

Another example could be a service that maps out an efficient route for the delivery of goods. In this case, a business sends a request with the delivery destinations, which the service then processes to determine the most cost-effective delivery route. The time it takes to return the response depends on the complexity of the routing; therefore, the response will probably be sent as an operation separate from the request.

Web services and their consumers are typically businesses, making Web services predominantly business-to-business (B-to-B) transactions. An enterprise can be the Web service provider and also the consumer of other Web services. For example, a wholesale distributor of spices is in the consumer role when it uses a Web service to check on the availability of vanilla beans and in the provider role when it supplies prospective customers with prices for vanilla beans.

The Role of XML and the Java Platform

Web services depend on the ability of parties to communicate with each other even if they are using different information systems. XML (eXtensible Markup Language), which makes data portable, is a key technology in addressing this need. Enterprises have discovered the benefits of using XML for the integration of data -- both internally for sharing legacy data among departments and externally for sharing data with other enterprises. As a result, XML is increasingly being used for enterprise application integration (EAI) in tightly coupled and loosely coupled systems. Thanks to its ability to integrate data, XML has become the underpinning for Web-related computing.

Overview of the Java APIs for XML (JAX APIs)

You can use the JAX APIs to develop Web applications entirely in the Java programming language. The APIs fall into two broad categories: those that deal directly with processing XML documents and those that deal with procedures.

Document-oriented

- Java API for XML Processing (JAXP) -- Processes XML documents with parsers.
- Java Architecture for XML Binding (JAXB) -- Processes XML documents with schema-derived JavaBeans component classes.

Procedure-oriented

- Java API for XML-based RPC (JAX-RPC) -- Sends SOAP method calls to remote parties over the Internet and receives the results.
- Java API for XML Messaging (SAAJ) -- Sends SOAP messages over the Internet in a standard way.
- Java API for XML Registries (JAXR) -- Provides a standard way to access business registries and share information.

Perhaps the most important feature of JAX APIs is that they all support industry standards, ensuring interoperability.

No comments:

Post a Comment