webservices sessions only work in debug mode ?????

  • Thread starter Antonio Lopez Arredondo
  • Start date
A

Antonio Lopez Arredondo

hi all !!!

I have developed a web service that uses sessions (enablesession=true in
webmethod attributes).

The web service works fine when called from the development environment or
from visual studio generated test pages.

However, when the same web service is called from a WinForms applicattion of
from an ASP.NET page running outside the debugger the session doesn't work.

is this by design or am I making a mistake ?

thanks in advance,
ant
 
I

Ing. Luis Alberto Calderon

See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/h
tml/service08062002.asp

You have to add the CookieContainer to the webservice.

As this,

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim proxy As New localhost.Service1()
Dim ret As Integer
' Set the Cookie Container on the proxy
If Cookies Is Nothing Then
Cookies = New System.Net.CookieContainer()
End If
proxy.CookieContainer = Cookies
ret = proxy.IncrementSessionCounter()
Label1.Text = "Result: " & CStr(ret)
End Sub

Bye,

L.
 

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
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top