Generic WebService (SOAP) client library for C++

Patrick picture Patrick · Nov 26, 2010 · Viewed 24k times · Source

I'm looking for a simple C++ WebService Client Library that can be easily linked into my application.

Preferably this library:

  • can be used to access any SOAP WebService (so I can pass the URL, the WebService name, the WebService method and all the arguments as arguments to a function call)
  • can be linked statically in a C++ application (so no DLL's)
  • is freeware or available at a low cost
  • can be used royalty-free in my application
  • can query the Web service for its WSDL and return me the available method names, arguments of the methods and their data types

Before anyone of you answers .NET: been there, tried it. My major objections against .NET are:

  • you can generate the proxy but it's impossible to change the WebService name in the generated proxy code afterwards, since .NET uses reflection to check the WebService name (see Dynamically call SOAP service from own scripting language for my question regarding that problem)
  • generating the proxy class on the fly doesn't always seem to work correctly

I already used Google to look up this information, but I couldn't find one.

Thanks

EDIT: To clarify this further, I really want something where I can write code like this (or something in this style):

SoapClient mySoapClient;
mySoapClient.setURL("http://someserver/somewebservice");
mySoapClient.setMethod("DoSomething");
mySoapClient.setParameter(1,"Hello");
mySoapClient.setParameter(2,12345);
mySoapClient.sendRequest();
string result;
mySoapClient.getResult(result);

No dynamic code generation.

Answer

Starkey picture Starkey · Nov 26, 2010

Have you looked at gSOAP? I think it will be suitable for your needs.

http://gsoap2.sourceforge.net/