Click to See Complete Forum and Search --> : Send Request to Web Service and get Statuscode


CrazyPlaya
May 27th, 2009, 04:19 AM
Hi @ all,

i want to send a request to a web service with standard vc++ not .NET.
The Url of request looks like this:
http//www.mypage.de/index.apsx?param1=x&param2=y

Now I want to send this parameters to the WebService. Which method i have to use to do this?
I´ve tried it with CInternetSession.OpenURL but I think that is the wrong method.
I need a method which gives me the status code back. i.e. 200 OK or 404 Not Found.

Best regards

Crazy

Doron Moraz
June 16th, 2009, 08:14 AM
Now I want to send this parameters to the WebService. Which method i have to use to do this?
I´ve tried it with CInternetSession.OpenURL but I think that is the wrong method.


After you create an instance of CInternetSession, call CInternetSession::GetHttpConnection() to establish HTTP connection and get a pointer to a CHttpConnection object that can manage the connection to the server.


Regards
Doron Moraz


EDIT: If the call to GetHttpConnection() fails, you can determine the cause of the failure by examining the thrown CInternetException object.