gpt4 book ai didi

c - [gsoap][C] 未定义 SOAP_TYPE_wchar

转载 作者:行者123 更新时间:2023-11-30 16:21:06 26 4
gpt4 key购买 nike

我坚持使用 gsoap 2.7.13(wsdl2h v1.2.1 和soapcpp2 v2.7.13)。当我尝试在纯 C 项目中将字符串映射到宽字符时,出现许多编译错误(SOAP_TYPE_wchar undefined)。

有人像我一样尝试过同样的问题吗?

问候,

我的 typemap.dat

[
struct SOAP_ENV__Header
{
_XML wsse__Security;
};
]

# Use unicode
xsd__string = | wchar_t* | wchar_t*

# CMIS recommended prefix
SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope"
SOAP-ENC = "http://schemas.xmlsoap.org/soap/encoding"
xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsd = "http://www.w3.org/2001/XMLSchema"
ns1 = "http://docs.oasis-open.org/ns/cmis/core/200908/"
ns2 = "http://docs.oasis-open.org/ns/cmis/messaging/200908/"
cmis = "http://docs.oasis-open.org/ns/cmis/ws/200908/"
cmis2 = "http://docs.oasis-open.org/ns/cmis/ws/200908/DiscoveryServicePortBinding"
cmis3 = "http://docs.oasis-open.org/ns/cmis/ws/200908/MultiFilingServicePortBinding"
cmis4 = "http://docs.oasis-open.org/ns/cmis/ws/200908/NavigationServicePortBinding"
cmis5 = "http://docs.oasis-open.org/ns/cmis/ws/200908/ObjectServicePortBinding"
cmis6 = "http://docs.oasis-open.org/ns/cmis/ws/200908/PolicyServicePortBinding"
cmis7 = "http://docs.oasis-open.org/ns/cmis/ws/200908/RelationshipServicePortBinding"
cmis8 = "http://docs.oasis-open.org/ns/cmis/ws/200908/RepositoryServicePortBinding"
cmis9 = "http://docs.oasis-open.org/ns/cmis/ws/200908/VersioningServicePortBinding"
cmis10 = "http://docs.oasis-open.org/ns/cmis/ws/200908/ACLServicePortBinding"

# End of file

还有我的命令行:

wsdl2h -c -o cmis_ws.h -t typemap.dat -x "http://docs.oasis-open.org/cmis/CMIS/v1.0/errata-01/os/schemas/CMISWS-Service.wsdl"
soapcpp2 -c -p cmis cmis_ws.h

最佳答案

纠正此问题的补丁:

  1. 编辑gsoap/src/symbol2.c第11201行并插入
  if (is_wstring(typ)) /* wchar_t* is serializable but wchar_t is transient */
return 0;

函数 is_transient 的第一部分应如下所示:

int
is_transient(Tnode *typ)
{
if (!typ)
return 1;
if (typ->type == Tstruct && typ->id == lookup("soap"))
return 1;
if (is_external(typ) || is_volatile(typ))
return 0;
if (typ->transient > 0)
return 1;
if (is_wstring(typ)) /* wchar_t* is serializable but wchar_t is transient */
return 0;
  • 再次运行make,您可以在gsoap/src目录中执行此操作。这会在 gsoap/src 目录中构建soapcpp2。将soapcpp2 复制到您的项目或$PATH 上的bin 目录。
  • 关于c - [gsoap][C] 未定义 SOAP_TYPE_wchar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54999400/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com