c++ - 如何在 C++ 中进行 soap 调用

标签 c++ xml soap client

我正在尝试找出独立于 wsdl 的 c++ soap 客户端的最佳方式。

我需要的是只知道函数的名称和参数列表来发送和发送它并接收 soap 响应或类似的东西(我知道这并不那么简单)。

我的想法是做这样的事情: SOAP Request and Response Read from and to file using libcurl - C 或者 http://www.cplusplus.com/forum/general/16225/

你能告诉我最好的方法吗,或者最好的方法是使用像 gSoap 这样的库并在 c++ 代码中执行 gSoap 生成的类的 c++ 方法?

谢谢

最佳答案

请注意,gSOAP 是 GPL 许可的。一个限制较少的选择是 Axis2/C++ .

使用 Axis2/C++,您可以从 WSDL 生成 stub ,并使用生成的类在您的代码中调用 Web 服务

生成 stub (是 Java,但这是一次性操作):

java org.apache.axis.wsdl.wsdl2ws.WSDL2Ws Calculator.wsdl -lc++ -sclient

然后使用:

#include "Calculator.h" 
#include <stdio.h> 
int main() 
{ 
  Calculator c; 
  int intOut; 
  c.add(20, 40, intOut); 
  printf("result is = %d\n", intOut); 
  return 0; 
}

More details here

关于c++ - 如何在 C++ 中进行 soap 调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13936430/

相关文章:

c++ - 循环链表的循环起始节点

c++ - 什么是 "Argument-Dependent Lookup"(又名 ADL,或 "Koenig Lookup")?

c++ - 返回不可复制对象的元组

javascript - XML文件和dtd关联

linux - Traceroute : target doesn't acknowledge packet just from a specific host. 来自其他主机的 Traceroute 工作正常。 Ping 在所有主机上都能正常工作

python - 我如何检查 "sudo 0.4.1 jurko 5"及更新版本中生成/接收的 SUD?

c# - 变量初始化(C# 和 C++)

xml - scalaxb 生成的代码在编译期间导致堆栈溢出

android - 波纹效果在滑动选项卡布局中不起作用

python - 在客户端 __init__ (Python suds) 上设置 useragent