CookieContainer not working reliably ASP.NET webclient

R

RT

Calling a .NET webservice (win2k3) from an ASP.NET webservice client
(xp). There is a farm of win2k3 servers hosting the webservice behind a
load balancer.

One part of our webservice is stateful by design and the session state
is achieved by the load balancer by inserting a cookie into the
response headers.

On the client, we are appropriately using the CookieContainer and
assigning the CookieContainer object to the proxy object as it is
supposed to be (there is a single instance of the proxy object and the
cookiecontainer object).

private OurWebService m_ws = new OurWebService();
private CookieContainer m_cookies;

later in the code while invoking a method on the webservice

if ( m_cookies == null )
m_cookies = new CookieContainer();
if ( m_ws.CookieContainer == null )
m_ws.CookieContainer = m_cookies;

m_ws.CallMethod();


We notice that sometimes the cookies are getting sent down as part of
the request header in the above call - and at other times they are
not!! When they dont get sent down, the cookiecontainer does not
contain the cookie at all. This is very random behavior and has us
completely mystified.

Any clues as to why?

Thanks
 

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,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top