When a Web service application is deployed into WebSphere Application
Server, an instance is created for each application or module. The instance
contains deployment information for the Web module or enterprise bean module,
including implementation scope, client bindings and deployment descriptor
information. There are three levels of scope that can be set: application,
session and request.
Before you begin
newfeat Important: The WebSphere Application Server Version
6.1 Feature Pack for Web Services extends the capabilities of this product
to introduce support for the Java API for XML-Based Web Services (JAX-WS)
2.0 programming model. JAX-WS is the next generation Web services programming
model complimenting the foundation provided by the Java API for XML-based
RPC (JAX-RPC) programming model. Using the strategic JAX-WS programming model,
development of Web services and clients is simplified through support of a
standards-based annotations model. Although the JAX-RPC programming model
and applications are still supported, take advantage of the easy-to-implement
JAX-WS programming model to develop new Web services applications and clients.
newfeat Supported configurations: The Feature Pack for Web Services does not support
Java Message Service (JMS) transports or enterprise beans. This product only
supports an HTTP transport and hosting JavaBeans endpoints within the Web
container for JAX-WS Web services applications. To develop enterprise beans
hosted as Web services, you must use the JAX-RPC programming model. This product
does allow JAX-WS clients to issue requests from any of the Java Platform,
Enterprise Edition (Java EE) containers along with the client Java 2 Standard
Edition (J2SE) environment.Configuring the
scope of a Web service port is supported with JAX-RPC applications.
sptcfg
Deploy
a Web service into the WebSphere Application Server. Read about deploying
Web services applications onto application servers.
About this task
Web Services for Java 2 platform Enterprise Edition (J2EE) specifies
that Web services implementations must be stateless. Therefore, to maintain
specification compliance, the scope can remain at the application level because
the state relevant to the individual sessions level or the requests level
is not supposed to be maintained in the implementation. If you want to deviate
from the specification and want to access a different JavaBean instance, because
you are looking for information that is located in another JavaBean implementation,
the scope settings need to change.
The setting that you configure for
the scope determines how frequently a new instance of a service implementation
class is created for the Web service ports in a module. Use this task to configure
the scope of a Web service port.
You can also configure the scope with the wsadmin
tool.
To change the scope setting through the administrative
console:
Procedure
- Open the administrative console.
- Click Applications >Enterprise applications > application_instance > Manage
modules > module_instance >Web services implementation scope.
- Set the scope to application, session or request. The
application scope causes the same instance of the implementation to be used
for all requests on the application. The session scope causes the same instance
to be used for all requests in each session. The request scope causes a new
instance to be used for every request. For example, with the scope set to
application, every message that comes to the server accesses the same JavaBean
instance because that is the way the scope settings are configured.
- Click Apply.
- Click OK.
Results
The scope for a Web service port is configured.
What to do next
Now you can finish any other configurations, start or stop the application,
and verify the expected behavior of the Web service.