DCSIMG
How to Consume WebService via unmanaged C++ - Ohad's Blog

Ohad's Blog

Lets talk about .net !

Mirror at:
weblogs.asp.net/israelio

News

         Ohad Israeli's Facebook profile

Grab this badge here!

How to Consume WebService via unmanaged C++

Someone asked me how to consume webservice using unmanaged c++ client.

1. Open your C++ project in Visual Studio 2003/2005
2. Right click on the project name in the solution explorer and add reference to the web service
    This operation will create the web service proxy and add if to your c++ solution.
3. Call the web service
    Assuming that you want to consume the basic HelloWorld webservice these are the lines that you need to add to your C++ app:

Service::CService proxy;
BSTR Result=NULL;
HRESULT hr = proxy.HelloWorld(&Result);
MessageBox(0,Result,CComBSTR("Hello World Result"),0);

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: