+

Search Tips   |   Advanced Search

Set the scope of a Web service port


When a JAX-RPC Web service application is deployed into WAS, 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.

Deploy a Web service into the WAS. To learn more, read about deploying Web services applications onto appservers.

The Web Services for Java EE specification states that Web services implementations must be stateless. Therefore, to maintain spec 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. To deviate from the spec and want to access a different Java Bean instance, because we are looking for information that is located in another Java Bean 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 wsadmin.

This task applies only to JAX-RPC Web services.

To change the scope setting in the admin console:

 

  1. Open the admin console.

  2. Click Applications > Application Types > WebSphere enterprise apps application_name > Manage Modules > module instance > Web services implementation scope

  3. 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 Java Bean instance because that is the way the scope settings are configured.

  4. Click Apply.

  5. Click OK.

 

Results

The scope for a Web service port is configured.

 

Next steps

Now we can finish any other configurations, start or stop the application, and verify the expected behavior of the Web service.


Web services implementation scope

 

Related tasks


Deploy Web services applications onto appservers
Set the scope of a Web service port with wsadmin
Web services client port information
Web services client bindings