2

I've got a legacy ASP.NET soap web service on my computer. The service has this annotation:

 [WebMethod(EnableSession = true)]

on several methods and uses the Session property to save some information:

Session[CONSTANT] = some_value;

This value is preserved when I call different methods of the web service one after another in a browser (both Chrome and Internet Explorer) but NOT when I call the service methods from a proxy created in Powershell or in Visual Studio. Do I have to set some parameters on the client to preserve the Session?

On another computer the same service is installed and there the value stored in the Session is NOT preserved between method calls, not even in the browsers. Do I need then to change some parameters in the web server in this case?

In both cases the web service is hosted in IIS.

Greg
  • 1,227
  • 5
  • 23
  • 52

1 Answers1

1

The following has done the job for me:

  1. adding a legacy web reference instead of service reference.
  2. using the SoapClient.CookieContainerlike in Implementing session in SOAP Client
Community
  • 1
  • 1
Greg
  • 1,227
  • 5
  • 23
  • 52