CAtlHttpClient Navigate fails

I have code as follows
I am sending a cookie as extra headers and sending some xml as post data
and navigating to a URL as follows

CAtlNavigateData  navData;
navData.SetExtraHeaders("Cookie:SessionID=" + strSessionId + ";");
navData.SetPostData((BYTE*)strWsrXml.GetBuffer(),strWsrXml.GetLength(),"text/html");

CAtlHttpClient cli;

if(!cli.Navigate(&m_urlServer, &navData))
{
     //It always fails If I send Extra headers
}

Navigate always returing false.....
I am using Tomcat as the web server
If I remove the line navData.SetExtraHeaders("Cookie:SessionID=" + strSessionId + ";");
It works fine...BUt I need to send the sesionid as a cookie

Help me.
ekarthaAsked:
Who is Participating?
 
CetusMODCommented:
PAQed with points refunded (250)

CetusMOD
Community Support Moderator
0
 
mahesh1402Commented:
Have you tried to execute CAtlHttpClient::NegotiateAuth() method before calling Navigate() ?
CAtlHttpClient::NegotiateAuth() attempts to meet the security requirements of the requested URL....

http://msdn2.microsoft.com/de-de/library/bh8x58dh.aspx <==

-MAHESH
0
 
ekarthaAuthor Commented:
No the problem is different.
If I set Cookie header before navigate It gets failed...If i remove the line of setting Cookie as extra header
it works fine.

the same thing works for Pramati Server...
But it doesn't work for TomCat server

Is there any se rver side settings?
0
 
ekarthaAuthor Commented:
I found the solution

we need to send a newline after the Cookie header as follows
navData.SetExtraHeaders("Cookie:SessionID=" + strSessionId + "\r\n");

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.