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

Discussion in 'ASP .Net Web Services' started by Antonio Lopez Arredondo, Nov 17, 2003.

  1. 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
     
    Antonio Lopez Arredondo, Nov 17, 2003
    #1
    1. Advertising

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

    "Antonio Lopez Arredondo" <> wrote in message
    news:#...
    > 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
    >
    >
     
    Ing. Luis Alberto Calderon, Nov 17, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    0
    Views:
    682
  2. =?Utf-8?B?TWF4?=
    Replies:
    0
    Views:
    482
    =?Utf-8?B?TWF4?=
    Feb 11, 2006
  3. rbg
    Replies:
    0
    Views:
    442
  4. sujeet
    Replies:
    5
    Views:
    592
    Bart van Ingen Schenau
    Sep 16, 2007
  5. Antonio Lopez Arredondo

    webservices sessions only run in debug mode ?????

    Antonio Lopez Arredondo, Nov 17, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    169
    Manni
    Nov 17, 2003
Loading...

Share This Page