This topic introduces you to using Web services. WebSphere Application
Server supports Web services that are developed and implemented based on a
variety of Java programming models. Use Web services when operating across
a variety of platforms, including the J2EE 1.4 and non-J2EE platforms.
About this task
Implementing Web services
applications is an easy way to integrate application systems together within
or outside your company’s infrastructure that otherwise function as 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. You can create a Web service for the customer database and then enable
the accounting application as a Web service client. The accounting application
can now 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.
You can use Web services applications
with WebSphere Application Server by following the steps provided:
- 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.
- (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, you need to migrate client applications
developed with all versions of 4.0, and versions of 5.0 prior to 5.0.2.
- Develop Web services applications. You can develop a
Web service in one of five ways:
- Develop Web services
using JavaBeans implementation.
You can create a Web
service by starting with an existing Java application. Transforming an existing
application into Web services is called a bottoms-up approach to developing
Web services. This process is called bottoms-up because you are starting with
the implementation rather than starting with an existing service or Web Services
Description Language (WSDL) file.
- Develop Web services
using a stateless session enterprise bean.
You can create
a Web service by starting with an existing stateless session enterprise bean
using a bottoms-up approach to developing Web services.
Note:
Enterprise
JavaBeans are only supported in JAX-RPC applications.
- Develop Web services
with an existing WSDL file using JavaBeans implementation.
You
can create a Web service by starting with an existing Web Services Description
Language (WSDL) file describing the service interface for a Java application.
Typically the WSDL is defined as part of the application modeling process.
Using an existing service definition or WSDL file to generate a new application
is called a top-down approach to developing Web services.
- Develop Web services with an
existing WSDL file using a stateless session enterprise bean.
You can create a Web service by starting with an existing WSDL file
describing the service interface of an enterprise bean implementation using
a top-down approach to developing Web services.
Note:
Enterprise
JavaBeans are supported in JAX-RPC applications only.
- Enable Web services
through service integration technologies
You can use
the Web services enablement of the service integration bus (SIBWS) to achieve
the following goals:
- Take an internally-hosted service that is available at a bus destination,
and make it available as a Web service.
- Take an external Web service, and make it available internally at a bus
destination.
- Use the Web services gateway to map an existing service -
either an internally-hosted service, or an external Web service - to a new
Web service that seems to be provided by the gateway.
Web services
can be developed to take advantage of Web Services Addressing (WS-Addressing)
and Web Services Resource Framework (WSRF) support.
- .
Web
services can be developed to take advantage of Web Services Addressing (WS-Addressing)
which aids interoperability between Web services using a standard way to address
Web services and providing addressing information in messages.
- .
The
Web Services Resource Framework (WSRF) support in WebSphere Application Server
enables you to implement a stateful Web service as a WS-Resource, and reference
it using a WS-Addressing endpoint reference.
- Assemble Web services.
This topic presents what you need to assemble a Web service and in
what order you should assemble the parts, for example an enterprise archive
(EAR) file.
- Deploy Web services.
This topic presents the steps necessary to deploy the EAR file that
has been configured and enabled for Web services.
- Administering deployed
Web services.
This topic introduces you to administering
deployed Web services applications.
- Publish the WSDL
file.
After installing a Web services application, and
optionally modifying the endpoint information, you might need Web Services
Description Language (WSDL) files containing the updated endpoint information.
This topic presents the steps necessary to publish the WSDL files so that
this information is available.
- Developing and
deploying Web services clients.
This topic explains how
to develop and deploy Web services client based on the Web Services for J2EE
specification.
- Secure Web services.
For information about integrating message-level security into a WebSphere
Application Server environment refer to:
- Monitoring the performance of Web services applications
.
This
topic includes information to help you use the Performance Monitoring Infrastructure
(PMI) to measure the time required to process Web services requests.
- Troubleshoot
Web services.
You can 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.
Using Web services, the flower shop owner can find wholesale
flower suppliers. 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 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 the procedure call. 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.
For
a more detailed scenario, see Web
services scenario: Overview which tells the story of a fictional online
garden supply retailer named Plants by WebSphere and how they incorporated
the Web services concept.