The industry standard for C / C ++ web services is gsoap. http://www.cs.fsu.edu/~engelen/soap.html
Provides mapping of XML Schema to C / C ++ using wsdl2h. It has good documentation and many samples in the package. Doc can also be found on the Internet . You can easily port your code on many operating systems (Linux, Windows, etc.).
Simpe example for adding to a number through a web service (call code)
#include "soapH.h" #include "calc.nsmap" main() { struct soap *soap = soap_new(); double result; if (soap_call_ns__add(soap, 1.0, 2.0, &result) == SOAP_OK) printf("The sum of 1.0 and 2.0 is %lg\n", result); else soap_print_fault(soap, stderr); soap_end(soap); soap_free(soap); }
With gsoap you do the work in two steps
- First create stubs (e.g. wsdl2java) from WSDL
- Then you call stubs with your objects
Also a great structure if you want to create your own service (act as a server, not just client code)
source share