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

    Send Request to Web Service and get Statuscode

    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

  2. #2
    Join Date
    Sep 2005
    Location
    London
    Posts
    208

    Re: Send Request to Web Service and get Statuscode

    Quote Originally Posted by CrazyPlaya View Post
    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.
    Last edited by Doron Moraz; June 17th, 2009 at 04:18 PM.

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