You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Jared Peterson <jp...@softprotech.com> on 2001/11/20 20:27:31 UTC

Scope Question

Hello,

I am attempting to deploy a SOAP service using Apache SOAP and Tomcat
and I have question about setting the scope for the service object.
Currently I have the scope set to application and it is my understanding
that in this case the same object is used to service all incoming
request.  In my case I need something a little different.  I need to for
all clients talking to the service to talk with a separate instance of
the service object but I do not want this instance to go away between
separate requests from the same client.  Is this possible?  The
following example should illustrate this a bit.

class FooService
{
    private String fooString;

    public void setFooString( String setString )
    {
        fooString = setString;
    }
    public String getFooString()
    {
        return fooString;
    }
}

If client A calls setFooString( "Blah" ) then calls getFooString() it
would be nice to have it return "Blah".  If client B calls setFooString(
"la" ) then calls getFooString() it should return "la".  Is this type of
scope possible?  If not what do the different scope options mean ... it
is not very clear in the docs.  It may be that there is another way to
get this type of functionality with SOAP, if so I would like to hear
suggestions.  Thanks for any help

Jared


Re: Scope Question

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
The "session" scope is what Jared needs, as you note below.

The client must maintain an HTTP session with the server to get
the desired semantics. If your client is also Apache SOAP then
that's supported thru the API - see the docs. If its something
else, then do whatever you have to do to maintain an HTTP session.

Sanjiva.

----- Original Message -----
From: "Fred Meredith" <fm...@nc.rr.com>
To: <so...@xml.apache.org>
Sent: Wednesday, November 21, 2001 3:03 AM
Subject: Re: Scope Question


> Set the scope to "Session."  But to do what you describe below, you may
have
> to keep track of some sort of session id... someone else on this list
might
> be able to comment on that.
>
> ----- Original Message -----
> From: "Jared Peterson" <jp...@softprotech.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, November 20, 2001 2:27 PM
> Subject: Scope Question
>
>
> > Hello,
> >
> > I am attempting to deploy a SOAP service using Apache SOAP and Tomcat
> > and I have question about setting the scope for the service object.
> > Currently I have the scope set to application and it is my understanding
> > that in this case the same object is used to service all incoming
> > request.  In my case I need something a little different.  I need to for
> > all clients talking to the service to talk with a separate instance of
> > the service object but I do not want this instance to go away between
> > separate requests from the same client.  Is this possible?  The
> > following example should illustrate this a bit.
> >
> > class FooService
> > {
> >     private String fooString;
> >
> >     public void setFooString( String setString )
> >     {
> >         fooString = setString;
> >     }
> >     public String getFooString()
> >     {
> >         return fooString;
> >     }
> > }
> >
> > If client A calls setFooString( "Blah" ) then calls getFooString() it
> > would be nice to have it return "Blah".  If client B calls setFooString(
> > "la" ) then calls getFooString() it should return "la".  Is this type of
> > scope possible?  If not what do the different scope options mean ... it
> > is not very clear in the docs.  It may be that there is another way to
> > get this type of functionality with SOAP, if so I would like to hear
> > suggestions.  Thanks for any help
> >
> > Jared
> >


Re: Scope Question

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
The "session" scope is what Jared needs, as you note below.

The client must maintain an HTTP session with the server to get
the desired semantics. If your client is also Apache SOAP then
that's supported thru the API - see the docs. If its something
else, then do whatever you have to do to maintain an HTTP session.

Sanjiva.

----- Original Message -----
From: "Fred Meredith" <fm...@nc.rr.com>
To: <so...@xml.apache.org>
Sent: Wednesday, November 21, 2001 3:03 AM
Subject: Re: Scope Question


> Set the scope to "Session."  But to do what you describe below, you may
have
> to keep track of some sort of session id... someone else on this list
might
> be able to comment on that.
>
> ----- Original Message -----
> From: "Jared Peterson" <jp...@softprotech.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, November 20, 2001 2:27 PM
> Subject: Scope Question
>
>
> > Hello,
> >
> > I am attempting to deploy a SOAP service using Apache SOAP and Tomcat
> > and I have question about setting the scope for the service object.
> > Currently I have the scope set to application and it is my understanding
> > that in this case the same object is used to service all incoming
> > request.  In my case I need something a little different.  I need to for
> > all clients talking to the service to talk with a separate instance of
> > the service object but I do not want this instance to go away between
> > separate requests from the same client.  Is this possible?  The
> > following example should illustrate this a bit.
> >
> > class FooService
> > {
> >     private String fooString;
> >
> >     public void setFooString( String setString )
> >     {
> >         fooString = setString;
> >     }
> >     public String getFooString()
> >     {
> >         return fooString;
> >     }
> > }
> >
> > If client A calls setFooString( "Blah" ) then calls getFooString() it
> > would be nice to have it return "Blah".  If client B calls setFooString(
> > "la" ) then calls getFooString() it should return "la".  Is this type of
> > scope possible?  If not what do the different scope options mean ... it
> > is not very clear in the docs.  It may be that there is another way to
> > get this type of functionality with SOAP, if so I would like to hear
> > suggestions.  Thanks for any help
> >
> > Jared
> >


Re: Scope Question

Posted by Fred Meredith <fm...@nc.rr.com>.
Set the scope to "Session."  But to do what you describe below, you may have
to keep track of some sort of session id... someone else on this list might
be able to comment on that.

----- Original Message -----
From: "Jared Peterson" <jp...@softprotech.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 20, 2001 2:27 PM
Subject: Scope Question


> Hello,
>
> I am attempting to deploy a SOAP service using Apache SOAP and Tomcat
> and I have question about setting the scope for the service object.
> Currently I have the scope set to application and it is my understanding
> that in this case the same object is used to service all incoming
> request.  In my case I need something a little different.  I need to for
> all clients talking to the service to talk with a separate instance of
> the service object but I do not want this instance to go away between
> separate requests from the same client.  Is this possible?  The
> following example should illustrate this a bit.
>
> class FooService
> {
>     private String fooString;
>
>     public void setFooString( String setString )
>     {
>         fooString = setString;
>     }
>     public String getFooString()
>     {
>         return fooString;
>     }
> }
>
> If client A calls setFooString( "Blah" ) then calls getFooString() it
> would be nice to have it return "Blah".  If client B calls setFooString(
> "la" ) then calls getFooString() it should return "la".  Is this type of
> scope possible?  If not what do the different scope options mean ... it
> is not very clear in the docs.  It may be that there is another way to
> get this type of functionality with SOAP, if so I would like to hear
> suggestions.  Thanks for any help
>
> Jared
>


Re: Scope Question

Posted by Fred Meredith <fm...@nc.rr.com>.
Set the scope to "Session."  But to do what you describe below, you may have
to keep track of some sort of session id... someone else on this list might
be able to comment on that.

----- Original Message -----
From: "Jared Peterson" <jp...@softprotech.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 20, 2001 2:27 PM
Subject: Scope Question


> Hello,
>
> I am attempting to deploy a SOAP service using Apache SOAP and Tomcat
> and I have question about setting the scope for the service object.
> Currently I have the scope set to application and it is my understanding
> that in this case the same object is used to service all incoming
> request.  In my case I need something a little different.  I need to for
> all clients talking to the service to talk with a separate instance of
> the service object but I do not want this instance to go away between
> separate requests from the same client.  Is this possible?  The
> following example should illustrate this a bit.
>
> class FooService
> {
>     private String fooString;
>
>     public void setFooString( String setString )
>     {
>         fooString = setString;
>     }
>     public String getFooString()
>     {
>         return fooString;
>     }
> }
>
> If client A calls setFooString( "Blah" ) then calls getFooString() it
> would be nice to have it return "Blah".  If client B calls setFooString(
> "la" ) then calls getFooString() it should return "la".  Is this type of
> scope possible?  If not what do the different scope options mean ... it
> is not very clear in the docs.  It may be that there is another way to
> get this type of functionality with SOAP, if so I would like to hear
> suggestions.  Thanks for any help
>
> Jared
>