session across two WS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • giatorta@hotmail.com

    session across two WS

    Hi all,

    I have a scenario where the client calls Web Service WS1 and WS1 calls
    Web Service WS2

    I have methods M1 on WS1 and M2 on WS2 both with EnabledSession= True

    assume M1 on WS1 does the following (in VB-like pseudocode):
    If (new session) Then
    Session("foo1") = "OLD1"
    Else
    Session("foo1") = "NEW1"
    EndIf
    call M2 on Web Service WS2

    and assume M2 on WS2 does the following:
    If (new session) Then
    Session("foo2") = "OLD2"
    Else
    Session("foo2") = "NEW2"
    EndIf

    if I call M1 twice from a client, Session("foo1") will be "NEW1"

    what about Session("foo2") ? will it be "NEW2"? if not, how is it
    possible to preserve session on Web Service WS2 across two calls to
    WS1?

    thanks a lot in advance,
    -Gianluca

  • Sami Vaaraniemi

    #2
    Re: session across two WS


    <giatorta@hotma il.com> wrote in message
    news:1121443221 .255285.148810@ f14g2000cwb.goo glegroups.com.. .[color=blue]
    > Hi all,
    >
    > I have a scenario where the client calls Web Service WS1 and WS1 calls
    > Web Service WS2
    >
    > I have methods M1 on WS1 and M2 on WS2 both with EnabledSession= True
    >
    > assume M1 on WS1 does the following (in VB-like pseudocode):
    > If (new session) Then
    > Session("foo1") = "OLD1"
    > Else
    > Session("foo1") = "NEW1"
    > EndIf
    > call M2 on Web Service WS2
    >
    > and assume M2 on WS2 does the following:
    > If (new session) Then
    > Session("foo2") = "OLD2"
    > Else
    > Session("foo2") = "NEW2"
    > EndIf
    >
    > if I call M1 twice from a client, Session("foo1") will be "NEW1"
    >
    > what about Session("foo2") ? will it be "NEW2"? if not, how is it
    > possible to preserve session on Web Service WS2 across two calls to
    > WS1?
    >
    > thanks a lot in advance,
    > -Gianluca[/color]

    ASP.NET sessions are based on cookies. On first call the the caller receives
    a cookie which it passes back to the web service on subsequent calls. The
    web service associates the calls with the session based on the cookie.

    So basically, if M1 maintains the cookie it receives from M2, and sends it
    to M2 on subsequent calls, then it should work out ok.

    Regards,
    Sami


    Comment

    Working...