web service lifetime

R

Robert Pfeffer

I created a very simple web service test on my local
machine (the web service and the web server on local).

The web service has two methods. One method is called
connect it connects to an odbc data source, loads a
dataset using a dataadapter.

The second method returns the dataset loaded by the first.

I created a simple web page that has 2 text fields for a
user name and password and a button. when the button is
pressed the first method of the service is invoked
passing the user name and password. The 1st method does
its job and loads the dataset.

The second method is then invoked to retrieve the
dataset. The second method always has and returns a
dataset with no rows. 1700 rows were there when the
first method exitted.

Do web service instances persist there local data between
invocations of their various methods?
thank you for your help.
 
M

MSFT

Yes, I agree with Michael. Web service is stateless. Even you have two
method in one web service, they are called for different request and from
differenct instance. When your call first web method, a instance will be
created on server and handle your request.; when you call second web
method, another instance will be create to handle it. both of these
instance don't share the dataset. I think you may return the dataset from
one web method instead of two.

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
R

Robert Pfeffer

Thank you for your responses. I thought that is what
happened, but searching msdn documentation is sometimes
time consuming, and did not answer my question.

Again, thanks everyone for your responses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top