-1

I want to make a call to a web service that is written in C#, through Visual C++ or C++ in Visual Studio 2010. I searched on web but was not able to find any point to point document. It would be a great help if you will tell me.

bluish
  • 26,356
  • 27
  • 122
  • 180
chiv
  • 165
  • 1
  • 2
  • 15

3 Answers3

2

If you're prepared to go with managed C++ then you can use WCF.

However, if this isn't an option then your best bet is to go with a socket approach. You'll need some cross-language way to represent the data your sending from C++ to C# and back again. Google Protobuf will help here as there are frameworks for both languages, in addition to many others.

Sean
  • 60,939
  • 11
  • 97
  • 136
  • i am using WCF but i am not able to send HTTP "POST" request through C++ to my service. – chiv Oct 08 '12 at 11:46
1

Have a look at Walkthrough: Accessing an XML Web Service Using C++.

bluish
  • 26,356
  • 27
  • 122
  • 180
thoaionline
  • 518
  • 2
  • 5
  • 14
1

A web service uses something JSON or XML as an interface and is inherently language independent. You would have to look for libraries that can create requests to the web service. For example if your web service in C# uses SOAP (XML) which it would if you created the default web service in Visual Studio you could create your own request in XML in accordance to the specifications of SOAP:

http://www.w3.org/TR/2000/NOTE-SOAP-20000508/

or use one of the libraries mentioned in this question:

Generic WebService (SOAP) client library for C++

Community
  • 1
  • 1
Sean Dawson
  • 5,587
  • 2
  • 27
  • 34