Hi,
I would propose 2 Solutions:

The first one is to add a field to your Resource. You know you can get the Resource with the statement:

Resource s = getResource()

Your Service Impl has to extend AbstractPortType, or AbstractPropertiesPortType for that.

The second solution is to use a static class:

class Service
{
   private staticClass =staticClass.getInstance();

ResponseDocument addOne(RequestDocument)
{
staticClass.addOne();
return new ResponseDocument(with a field containing "tmp")
} }


I know when using Axis, you can choose to have one instance of your service for all Sessions

<service name="MyService"...>
 <parameter name="scope" value="Application"/>
 ...
</service>

i dunno if this works for Apollo too

hope that helps

stefan

Shahzad Younas wrote:

Hi,
I was wondering, lets say I have a method in my service class:
class Service
{
private int tmp=1;
ResponseDocument addOne(RequestDocument)
{
tmp++;
return new ResponseDocument(with a field containing "tmp")
} }
if i call this method once (for a given resource ID) (by call, i mean send a SOAP Request containing the RequestDocument) , i will get a value of 2 returned.
Ifi call it again, with the same resource ID, will i get a value of 3 returned? IE by state, do we mean that all variables for the service are preserved for each resource ID?
I am abit confused. I know ResourceProperties should hold stateful values, but I need for the service private variables to be maintained too.
Thanks
Shahzad



-- My place : http://user.cs.tu-berlin.de/~lischke


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to