You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by GAURAV TIWARI <ga...@gmail.com> on 2009/10/27 18:09:52 UTC
Help regarding Scope of Service
Hi,
I created this simple class
public class MyService
{
int c;
MyService(){
c=0;
}
public int serviceMethod()
{
c++
return c;
}
}
And I deployed it into axis using this descriptor
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="MyService" provider="java:RPC">
<parameter name="className" value="MyService"/>
<parameter name="allowedMethods" value="*"/>
<parameter name="scope" value="Application"/>
</service>
</deployment>
The axis user Guide mentions that scope="Application" implies that all
the request would be served from the singleton object.
"Application" scope will create a singleton shared object to service
all requests"
However every time I call the service the value returned is 1 which
means that a new object is being created every time.
Please suggest.
Thanks and Regards
Gaurav