gsoap 中的重大更改(将版本从 2.8.8 更新到 2.8.16)
Breaking changes in gsoap (updating version from 2.8.8 to 2.8.16)
我有一个使用 gSoap 的C++客户端。当它使用2.8.8版本的gSoap时,它运行良好。升级到 2.8.16 后,它停止工作。问题似乎如下:我们缺少肥皂信封。发送的旧版本:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="urn:attachmentSoapServer"><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<data here>
</SOAP-ENV:Body></SOAP-ENV:Envelope>
新版本仅发送:
<data here>
如何像旧版本一样添加肥皂标题?
代码是这样的:
struct soap soap;
soap_init(&soap);
soap_call_here(...);
请检查 wsdl2h 警告消息和生成的 .h 接口文件。
为了确保 SOAP 传输,生成的 .h 文件应具有:
//gsoap ns1 service transport: http://schemas.xmlsoap.org/soap/http
对于每个服务操作,我们期望如下:
//gsoap ns1 service method-protocol: method SOAP
如果方法协议是HTTP(或POST,GET,PUT),那么将使用没有SOAP信封和没有SOAP正文的REST。
命名空间
不应该在 XXXBinding.h 中定义,它是由 soapcpp2 自动生成的.exe如下所示?或者必须在代码中更改它。
MyServiceSoap12Binding()
{
soap = soap_new();
if (soap && !soap->namespaces)
{
static const struct Namespace namespaces[] =
{
{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL},
{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL},
{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
//...
{NULL, NULL, NULL, NULL}
};
soap->namespaces = namespaces;
}
}
相关文章:
- C++版本,它们的含义,如何更新它们
- 更新到 2020 年 5 月版本后,无法在 Visual Studio 2019 中创建.exe文件
- 更新 g++ 但仍然是旧版本
- 在CentOS 7上安装GCC 7.4.0不会更新我的LIBSTDC 版本
- C++自动更新到新版本
- 使用WinSparkle更新新版本后,它不会自动启动应用程序
- 版本信息表 通过更新资源更改 pe 文件
- 如何使用比系统提供的更新版本的clang链接到线程消毒剂
- 如何在Debian上获得GCC/++4.6或更新版本
- 在Visual Studio 2005中自动更新版本号(C++/C#)
- 更新版本化的 .NET 程序集引用
- 更新依赖于 Boost 库的库的 Boost 版本,而无需重新链接
- 如何使用 c++/QT 在控制面板中更新应用程序版本auto_update
- 如何更新 clang 版本以编译 C++11 项目?(在 Mac 上)
- gsoap 中的重大更改(将版本从 2.8.8 更新到 2.8.16)
- 安装更新版本的libpng
- 如何在TFS 2012更新1版本中构建CPP项目
- 查找更新版本的应用程序
- 在文本文件中更新版本
- 如何使用g++ 4.7或更新版本强制launchpad构建我的包?