web service session works while debugging but not when its published

I'm finishing up my first web service. It stores data on a dataset that I later need to check up on, so I need to keep that information around.

I've already enabled the session in the web service's method "EnableSession = true"

[WebMethod(Description = "Receives status requests, as well as status udpates.", EnableSession = true)]

If I debug the web service everything works but if I try to use the application that sends the requests to the web service while it is published, the session keeps restarting again and again and again. Can anyone please tell me who do I have to kill to get this going?

Answers


You have to setup a cookie container in the client:

var cookieContainer = new System.Net.CookieContainer();
client.CookieContainer = cookieContainer;

Need Your Help

What are the implications of registering an instance method with atexit in Python?

python atexit

Assume I've got some really big Python class that might consume a fair amount of memory. The class has some method that is responsible for cleaning up some things when the interpreter exits, and it...

How do I split a large xml file?

xml windows

We export “records” to an xml file; one of our customers has complained that the file is too big for their other system to process. Therefore I need to split up the file, while repeating the “he...