CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Location
    Bangalore
    Posts
    12

    How to check Server Response?

    Hi,

    I am connecting funambol server(Http Session).
    I want to add some contacts to funambol server(To Synchronize Contact with Client).

    I m sending data through below mention API.

    HttpSendRequest(hInternet, headers, wcslen(headers), szHeader,wcslen(szHeader));
    szHeader = "Data contains"

    I am checking the response using InternetReadFile( hInternet, buffer, 10000, &dwRead )

    Reading buffer data? Is this a wrong way?
    If yes then : How to check the response?
    Please reply me if information is not sufficient.

    Thanks in Advance.


    Data Contains :-
    <SyncML>
    <SyncHdr>
    <VerDTD>1.1</VerDTD>
    <VerProto>SyncML/1.1</VerProto>
    <SessionID>210</SessionID>
    <MsgID>1</MsgID>
    <Target>
    <LocURI>http://abc.dyndns.org:8080/funambol/ds</LocURI>
    </Target>
    <Source>
    <LocURI>111111111111111</LocURI>
    <LocName>guest</LocName>
    </Source>
    <Cred>
    <Meta>
    <Format>b64</Format>
    <Type>syncml:auth-basic</Type>
    </Meta>
    <Data>Z3Vlc3Q6Z3Vlc3Q=</Data>
    </Cred>
    <Meta>
    <MaxMsgSize>10000</MaxMsgSize>
    <MaxObjSize>64000</MaxObjSize>
    </Meta>
    </SyncHdr>
    <SyncBody>
    <Add>
    <CmdID>15</CmdID>
    <Meta>
    <Format xmlns="’syncml:metinf’">chr</Format>
    <Type xmlns="’syncml:metinf’">text/x-vcard</Type>
    </Meta>
    <Item>
    <Source>
    <LocURI>./2</LocURI>
    </Source>
    <Data>
    BEGIN:VCARD
    VERSION:2.1
    FN:Bruce Smith
    N:Smith;Bruce
    TEL;WORK;VOICE:+1-919-555-1234
    TEL;WORK;FAX:+1-919-676-9876
    EMAIL;INTERNET:bruce1@host.com
    END:VCARD
    </Data>
    </Item>
    </Add>
    <Final></Final>
    </SyncBody>
    </SyncML>

  2. #2
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: How to check Server Response?

    Quote Originally Posted by MSDN on InternetReadFile
    A normal read retrieves the specified dwNumberOfBytesToRead for each call to InternetReadFile until the end of the file is reached. To ensure all data is retrieved, an application must continue to call the InternetReadFile function until the function returns TRUE and the lpdwNumberOfBytesRead parameter equals zero.
    Check out InternetReadFile.

    - petter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured