Consuming AXIS w/ headers from .NET

Discussion in 'ASP .Net Web Services' started by jEru, Oct 20, 2004.

  1. jEru

    jEru Guest

    Hey All,
    I've been successful in authenticating to a particular rpc-based,
    AXIS web service by adding my own "BASIC Authorization" header to the
    soap request (by overriding the GetWebRequest() method), but when the
    response is returned I'm not able to pull the sessionID out from the
    header. I've confirmed that the sessionID is, in fact, being placed
    in the header, but am not sure how to go about retrieving it.
    Should I modify the wsdl to add that specific binding manually or
    should I do the plumbing and yank the sessionID from the header myself
    before it's deserialized by the framework? Either way, how would I go
    about it?

    Thanks,
    jEru
     
    jEru, Oct 20, 2004
    #1
    1. Advertising

  2. sessionid is the http header?
    I think you need a cookieContainer.

    The HttpWebRequest class has a CookieContainer property that is null by
    default. Create a new CookieContainer and assign it to the request. this
    will automagically take care of retrieving the session id and re-posting it
    on future requests.

    example
    http://blogs.msdn.com/adarshk/archive/2004/08/24/219714.aspx

    if you for some reason need to do this manually, after the first response
    you can call CookieContainer.GetCookies( requestUri ) and look through the
    cookies. The server-side session is associated to the client via a cookie
    variable named "ASP.NET_SessionId". So you can learn the session id value
    and do with it what you want.


    --
    Dino Chiesa
    Microsoft Developer Division
    d i n o c h @ OmitThis . m i c r o s o f t . c o m


    "jEru" <> wrote in message
    news:...
    > Hey All,
    > I've been successful in authenticating to a particular rpc-based,
    > AXIS web service by adding my own "BASIC Authorization" header to the
    > soap request (by overriding the GetWebRequest() method), but when the
    > response is returned I'm not able to pull the sessionID out from the
    > header. I've confirmed that the sessionID is, in fact, being placed
    > in the header, but am not sure how to go about retrieving it.
    > Should I modify the wsdl to add that specific binding manually or
    > should I do the plumbing and yank the sessionID from the header myself
    > before it's deserialized by the framework? Either way, how would I go
    > about it?
    >
    > Thanks,
    > jEru
     
    Dino Chiesa [Microsoft], Oct 27, 2004
    #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. umhlali
    Replies:
    0
    Views:
    2,063
    umhlali
    May 27, 2004
  2. Replies:
    0
    Views:
    1,001
  3. Filipe Marcelino
    Replies:
    4
    Views:
    773
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Aug 27, 2007
  4. Parag Mahajan
    Replies:
    0
    Views:
    204
    Parag Mahajan
    Jan 28, 2005
  5. kelvlam
    Replies:
    0
    Views:
    281
    kelvlam
    Sep 5, 2006
Loading...

Share This Page