Request session scope is the default session scope in Axis2. When we deploy a service without knowing anything about session management, our service will be deployed in the request session scope. The lifetime of this session is limited to the method invocation lifetime or the request processing time. When we deploy a service in the request scope, it simply means that we are not going to worry about the session management at all. So it is like having no session management.
Once we deploy a service in the request session scope, for each and every invocation, a new service implementation class will be created. Say we have to deploy a service called
Foo
in the request scope; then if a client invokes the service ten times, 10 instances of the service class will be created.
If we want to specify the scope explicitly, we can still do that by adding a scope attribute to the service element in services.xml
, as follows. However, as mentioned earlier, deploying a service in the...