0

While it's well known that Websphere's JAX-WS implementation is based on Axis2, I have had trouble finding information how to set "scope" for the service.

In axis 2 scope can be defined using services.xml. Is this file also available in Websphere?

http://axis.apache.org/axis2/java/core/docs/axis2config.html

scope: (Optional Attribute) The time period during which runtime information of the deployed services will be available. Scope is of several types- "application", "soapsession", "transportsession", "request". The default value (if you don't enter any value) will be "request"

Sami Korhonen
  • 1,254
  • 8
  • 17
  • 1
    AFAIK, this config parameter is not part of the JAX-WS standard. Why do you want to manually set it? In general a WS should be stateless... – home Nov 20 '12 at 18:17
  • Because I would rather save cache in local variable that gets destroyed with the container than in a static variable that gets destroyed when class gets unloaded. As far as I know most containers create only single instance per jvm. Single instance (or pooled instances - websphere doesn't support them either) is far more efficient solution with a service that has expensive initialization – Sami Korhonen Nov 20 '12 at 20:43

1 Answers1

1

It seems it is possible to do what you want in WebSphere (not using services.xml): Configuring the scope of a Web service port using wsadmin scripting

Did not try it myself, also, could not find such settings in the admin console or deployment descriptor of some kind but that might be possible as well.

Aviram Segal
  • 10,962
  • 3
  • 39
  • 52
  • This sounds like a plausible solution. Unfortunately I'm unable to test it before next monday. I did more research on the subject and noticed that there is a deployment descriptor configuration option for JAX-RPC through ibm-webservices-bnd.xmi (http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Frwbs_assembprop.html) – Sami Korhonen Nov 21 '12 at 17:09
  • Yes I noticed that also but it is only for JAX-RPC... I might have some time tomorrow to test this. Might also help for my project – Aviram Segal Nov 21 '12 at 20:24