Implementing Web services applications

This topic introduces you to using Web services that are based on the Web Services for J2EE specification. WebSphere Application Server supports Web services that are developed and implemented based on Web Services for J2EE. Use Web services when operating across a variety of platforms, including the J2EE 1.4 and non-J2EE platforms.

 

Before you begin

Using Web services makes most sense if your application clients are non-J2EE applications, unless you have J2EE applications spread across the Web. It is recommended that you use J2EE technologies if all your clients are J2EE applications because performance can decrease when you use a Web service in a J2EE exclusive environment.

Decide if a Web service implementation benefits your business process.

 

Overview

Implementing Web services applications is an easy way to integrate application systems together within or outside your company's infrastructure that otherwise function as a standalone systems. For example, your customer information database is a standalone application, but you want your accounting application to be able to access the customer data. We can create a web service for the customer database and then enable the accounting application as Web service client. Now, the accounting application can access the customer information. By implementing a Web service, these two applications can share information in an efficient manner.

Because Web services are easily applied to existing applications and information technology assets, new solutions can be deployed quickly and recomposed to address new opportunities. As Web services become more popular, the pool of services grows, promoting development of more robust models of just-in-time application and business integration over the Internet. Use Web services applications with WAS by following the steps provided:

 

Procedure

  1. Plan to use Web services. Review the Universal Description, Discovery, and Integration (UDDI) and Web services enablement of the service integration bus (SIBWS) concepts to learn how these components can make your Web services plan more robust.

  2. (Optional) Migrate existing Web services.

    If you have used Web services based on Apache SOAP and now want to develop and implement Web services based on the Web Services for J2EE specification, we need to migrate client applications developed with all versions of 4.0, and versions of 5.0 prior to 5.0.2.

  3. Develop Web services.

    This topic is a good starting point in learning about how to develop a J2EE Web service.

  4. Configure Web services deployment descriptors.

    Configure the deployment descriptors so that WAS can process the incoming Web services requests.

  5. Assemble Web services.

    This topic presents what we need to assemble a Web service and in what order you should assemble the parts, for example an enterprise archive (EAR) file.

  6. Deploy Web services.

    This topic presents the steps necessary to deploy the EAR file that has been configured and enabled for Web services.

  7. Configure Web service client bindings. This topic explains how to edit bindings for a Web service after these bindings are deployed on a server. When one Web service communicates with another Web service, configure the client bindings to access the downstream Web service.

  8. Publish the WSDL file.

    After installing a Web services application, and optionally modifying the endpoint information, you might need WSDL files containing the updated endpoint information. This topic presents the steps necessary to publish the WSDL files so that this information is available.

  9. Develop Web services clients.

    This topic explains how to develop a Web services client based on the Web Services for J2EE specification.

  10. Secure Web services.

    This topic presents the methods used to integrate message-level security into a WebSphere Application Server environment. I If you are using V5.x, refer to Securing Web services for v5.x applications based on WS-Security. If you are using V6.x, refer to Securing Web services for v6 applications based on WS-Security

  11. Tune Web services.

    This topic includes information to help you use the Performance Monitoring Infrastructure (PMI) to measure the time required to process Web services requests.

  12. Troubleshoot Web services.

    Use this topic to learn more about troubleshooting different processes used to develop, implement and use Web services, including command-line tools, Java compiling errors, client runtime errors and exceptions, serialization and deserialization errors, and authentication challenges and authorization failures with Web services security.

 

Example

The following example illustrates how a business might use Web services.

The owner of a flower shop wants to start receiving orders from customers through the Web. This owner starts the process by finding wholesale flower suppliers, pricing the product, and completing contracts for future flower orders. One way to find new suppliers is to use a Universal Description, Discovery and Integration (UDDI) registry to search for potential suppliers. When the suppliers are chosen, the registry sends back information on how to contact the flower distributors that meet the flower shop owner's criteria.

The flower shop owner can request price lists from each of the suppliers by obtaining a Web Services Description Language (WSDL) file for each potential supplier. The WSDL can be downloaded from the supplier's Web page, received through e-mail, or retrieved from the supplier's UDDI registry entry.

The WSDL describes the procedure call. When using WebSphere Application Server, the procedure call is a Java API for XML-based remote procedure call (JAX-RPC), which retrieves price lists. The WSDL file also specifies the Universal Resource Locator (URL) where the request is sent.

The flower shop owner now has to compare the prices received back from each supplier, decide which suppliers to do business with, and make arrangements for future orders to fill. The flower shop can now sell merchandise through the Web by using Web services to communicate with suppliers for the best prices and complete the ordering processes. The merchandise price lists need publishing to the Web site and a mechanism is needed for customers to order flowers.

The Web services clients of the flower supplier are deployed on the flower shop server. When a customer makes a transaction to purchase flowers through the Web, the order is sent to the supplier through JAX-RPC. The supplier responds by sending a confirmation with the order number and shipping date. The suppliers maintain the inventory and the flower shop owner handles billing and customer order management.

Similarly, the flower shop catalog can be composed automatically from the catalogs of all the suppliers. If the supplier ships directly to the customer, the order tracking inquiries can pass directly to the supplier's order tracking system. The supplier can also use Web services to send invoices for orders and by the flower shop to pay the supplier's invoices. Processes that previously required forms to fill manually, and fax or mail, can now be done automatically, saving labor costs for both the flower shop and the supplier.

Using Web services is beneficial because a much larger inventory is made available to the flower shop. No merchandise maintenance overhead exists, but the flower shop can offer their customers products that they otherwise might not have. Selling flowers through the Web increases capital for the flower shop without overhead of another store or money invested into additional product. Web services scenario: Overview

 

See also


Web services
Web Services for J2EE specification
JAX-RPC
SOAP
SOAP with Attachments API for Java
Web Services-Interoperability Basic Profile
RMI-IIOP using JAX-RPC
WS-I Attachments Profile
Planning to use Web services
Migrating Apache SOAP Web services to Web Services for J2EE standards
Web services migration best practices
Developing Web services applications
Configuring Web services deployment descriptors
Assembling Web services applications
Deploying Web services
Publishing WSDL files
Developing Web services clients
Configuring Web service client bindings
Configuring the scope of a Web service port
Configuring Web services applications with the wsadmin tool
Securing Web services for v6.0.x applications based on WS-Security
Securing Web services for v5.x applications based on WS-Security
Monitoring the performance of Web services applications
Troubleshooting Web services
Web services: Resources for learning

 

See Also


Overview: Online garden retailer Web services scenarios
Service-oriented architecture
Web services approach to a service-oriented architecture
Web services business models supported

 

Related Tasks


Testing Web services-enabled clients