Consuming AXIS w/ headers from .NET

J

jEru

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
 
D

Dino Chiesa [Microsoft]

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.
 

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,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top