Click to See Complete Forum and Search --> : [RESOLVED] Getting Error :- 404


akshu
December 5th, 2008, 03:51 AM
Hello Everyone,

I am working on client server application.
i am Using HttpSendRequest() function with passing headers as the parameters.

I am getting Error 404.

Code snipet :-

nResult = HttpSendRequest(m_hInternet, headers,
wcslen(headers),szHeader,wcslen(szHeader));

headers :- wsprintf(headers,TEXT("Content-Type: %s\r\nContent-Length:
%d\r\nAccept-Encoding: deflate\r\nUncompressed-Content-Length: %d\r\nContent-Encoding: deflate"),
SYNCML_CONTENT_TYPE,&dwOptionalLength,&dwOptionalLength);

PWSTR szHeader = L"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><SyncML><SyncHdr>
<VerDTD>1.1</VerDTD><VerProto>SyncML/1.1</VerProto><SessionID>1</SessionID>
<MsgID>1</MsgID><Target><LocURI>http://192.168.179.164:8080/funambol/ds</LocURI></Target><Source>
<LocURI></LocURI></Source><Cred><Meta>
<Type xmlns=\"syncml:metinf\">syncml:auth-basic</Type></Meta><Data>ZZ3Vlc3Q=</Data></Cred><Meta>
<MaxMsgSize>250000</MaxMsgSize>
<MaxObjSize>4000000</MaxObjSize></Meta><SyncHdr><SyncBody><Final/></SyncBody></SyncML>";

Can anyone suggest what i am doing wrong.

Any more information needed tell me.

Thanks in advance.

ahoodin
December 5th, 2008, 11:37 AM
well that is the error for url or page not found.

akshu
December 6th, 2008, 04:51 AM
If i am using 'GET' instead of 'POST' in HttpOpenRequest i am not getting any Error.

I am suspecting that there is a problem in Headers what ever i am sending in sendRequest().
Can anyone tell me where i can find the proper Header information.like <LocURI> what data needs to send? With examples.

akshu
December 8th, 2008, 11:34 AM
Problem is Solved.
Header length were wrong