Session variable and WebServices

  • Thread starter Thread starter Gvnn
  • Start date Start date
G

Gvnn

Hi,
I've few problem with Session Variables and WebServices.
I've a web application (.aspx), and I assign a Session variable ( ex:
Session.Add("COD",Value) ). Then I call a WebService. I need that the
service read the value of the session variable, but if i try i retrive a
null value.
Can anyone help me?

Thanks

Gvnn
 
Gvnn,

If you are making the call through a proxy, then the web service is
going to be assigned a new session id because it considers the ASPX page the
same as any other client. What you need to do is actually instantiate the
class that is behind the webservice and call the method directly.

Hope this helps.
 
did you set 'EnableSession' to True in the 'WebMethod' attribute ? it's
false by default ...

if you want your web service to have it's own session variables you'll have
to do more work... try to search for 'WebMethodAttribute.EnableSession
Property' in MSDN Library (or http://msdn.microsoft.com) for a starting
point

hope it helps
 
Back
Top