J2EE In Web Services
Web services are providing the infrastructure and tools for automating
business-to-business relationships over the Internet.
The Java 2 Platform, Enterprise Edition (J2EE) was developed to
integrate web services.
The integration of web services into the J2EE 1.4 platform simplifies
the task of building and consuming web services, by releasing Java
developers from the low-level details of XML and web services standards.
Benefits Of Using J2EE In Web Services
The benefits of using the J2EE platform for web services include:
- Portability
- Scalability
- Reliability
- Vendor independent
J2EE containers provide transaction support, database connections,
life cycle management, and other services that are scalable and
require no code from application developers.
Developing In J2EE
Developing web services normally requires extensive knowledge of
XML-based standards and protocols [WSDL and
SOAP], and programming experience.
Java APIs for XML Registries [JAXR] and Java APIs are automatically
generated for XML Remote Procedure Calls [JAX-RPC]
Using the J2EE 1.4 platform, developing web services is seamless.
Knowledge of WSDL and SOAP are not required. Instead, the mapping
between the Java language and XML-based standards is handled by
the web service runtime system. This frees developers from low level
programming to concentrate of the application function.
Building an XML-RPC style web service using the J2EE 1.4 platform
involves five easy steps:
- Design and code the web service endpoint interface
- Implement the interface
- Write a configuration file
- Generate the necessary files
- Use the deploytool to package the service in a WAR file and
deploy it.
Deploying J2EE Web Services
The J2EE 1.4 platform supports web services through:
- JAX-RPC 1.1 API - to develop service endpoints
based on SOAP. JAX-RPC 1.1 interoperability with web services
is based on the Web Services Description Language [WSDL]
and Simple Object Access Protocol [SOAP].
- JSR 109 - builds upon JAX-RPC focusing on
the programming model for implementing web services, as well as
deploying web services in the J2EE 1.4 platform.
- WS-I Basic Profile - to extend portabilty beyond
J2EE implementations to any web service developed using WS-I compliant
platforms.
JSR 109
JSR 109 [Implementing Enterprise Web Services] is The Java Community
Process [JCP] specification.
It leverages J2EE technologies to provide an industry standard
for developing and deploying web services on the J2EE platform,
as well as providing a service architecture familiar to J2EE developers.
Development Lifecycle
The JSR 109 specification outlines the lifecycle of web services:
- Development - Standardizes the web services
programming model as well as the deployment descriptors
- Deployment - Describes the deployment actions
expected of a J2EE 1.4 container
- Service publication - Specifies how the WSDL
is made available to clients
- Service consumption - Standardizes the client
deployment descriptors and a JNDI lookup model
J2EE 1.4 Platform
The J2EE 1.4 SDK includes:
- J2EE 1.4 Application Server
- Java 2 Platform, Standard Edition (J2SE) 1.4.2_01
- J2EE Samples (Java Pet Store, Java Adventure Builder, Smart
Ticket, and others)
- Sun ONE Message Queue
- PointBase Database Server
Download
J2EE 1.4 Platform
How A J2EE Web Service Works
- A Java User Client makes a request.
- The request is handled by the client-side runtime JAX-RPC.
- The JAX-RPC API maps the Java to XML to assemble an XML-based
Remote Procedure Calls [RPC] to clients that use RPC and XML.
- The RPC uses an XML-based protocol such as SOAP [to define the
envelope structure, encoding rules, and convention for representing
RPC calls and responses] to transmit a SOAP messages over HTTP.
- The client - a proxy [or a local object that represents the
remote service] that is automatically generated.
- The client accesses the SOAP message via the web service port
using a Service Endpoint Interface as defined by JAX-RPC.
- The remote client receives the RPC and determines whether it
is acceptable according to its programmed rules.
- If the RPC is accepted, The SOAP handler actions container services.
- The SOAP message is dissassembled, the XML is mapped back to
Java.
- The web service methods perform business logic on behalf of
the client, by invoking the methods on the proxy. J2EE web services
can be invoked by any web service client, and any J2EE web service
client can invoke any web service.
- The Java response is mapped back to XML to the SOAP message
container and routes back via the SOAP message handler, Web services
Port to another SOAP handler on the user-client, maps the XML
back to Java so the response can be displayed to the user.
NOTE: The developer does not need to generate or parse SOAP messages;
this is done by the JAX-RPC runtime system.
Also See:
Back To Top
|