Session variable and WebServices

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
B

BenoitM

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
 

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

Top