C++ gSOAP wsdl types
C++ gSOAP wsdl types
我正在处理一个.wsdl文件,为gSOAP定义一个服务。在一个服务请求中,我想使用用户定义的类型作为请求的一部分,但是我不能正确使用,并且不知道问题是什么:
<definitions name="Uploader"
targetNamespace="http://192.168.2.113/uploader/uploader.wsdl"
xmlns:tns="http://192.168.2.113/uploader/uploader.wsdl"
[...]>
[...]
<types>
<schema targetNamespace="http://192.168.2.113/uploader/uploader.wsdl"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="FileInformation">
<complexType><all>
<element name="sFilename" type="string"/>
<element name="bDirectory" type="boolean"/>
</all></complexType>
</element>
[...]
<element name="UploadRequest">
<complexType><all>
<element name="fileInfo" type="tns:FileInformation"/>
</all></complexType>
</element>
[...]
</schema>
</types>
[...]
</definitions>
当我尝试用wsdl2h -o Uploader.h http://192.168.2.113/uploader/uploader.wsdl
生成头文件时,fileInfo
成员将被定义为字符串,我得到以下警告:
Warning: could not find element 'fileInfo' type '"http://192.168.2.113/uploader/uploader.wsdl":FileInformation' in schema http://192.168.2.113/uploader/uploader.wsdl
我曾尝试自己编写一些WSDL文件,但是我发现它们很难正确编写,主要是因为XML名称空间,所以我建议您使用c++编写类,并从它们自动生成WSDL文件,而不是使用其他方法。
如果这是不可能的,我建议看看这个线程。我想如果你把你的模式改成这样,它可能会起作用:
<definitions name="Uploader"
targetNamespace="http://192.168.2.113/uploader/uploader.wsdl"
xmlns:tns="http://192.168.2.113/uploader/uploader.wsdl">
<types>
<schema targetNamespace="http://192.168.2.113/uploader/uploader.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="FileInformation" type="tns:FileInformation" />
<xsd:complexType name="FileInformation">
<xsd:all>
<xsd:element name="sFilename" type="string"/>
<xsd:element name="bDirectory" type="boolean"/>
</xsd:all>
</xsd:complexType>
<xsd:element name="UploadRequest" type="tns:UploadRequest"/>
<xsd:complexType name="UploadRequest">
<xsd:all>
<xsd:element name="fileInfo" type="tns:FileInformation"/>
</xsd:all>
</xsd:complexType>
</schema>
</types>
</definitions>
相关文章:
- 使用 cmake 的 LLVM 构建在 tsan_libdispatch_mac.cc 期间失败; "Error: conflicting types for ..."
- gSoap在从.wsdl创建.h期间出现错误
- 构建 TensorFlow r1.14 C++文件时缺少文件"tensorflow/core/framework/types.pb.h"
- 为什么"types may not be defined in parameter types"
- 如何在Arduino程序中解决"invalid operands of types"?
- 为没有 WSDL 的 Gsoap 创建一个标头
- 错误"invalid types ... for array subscript"是什么意思?
- ONVIF:配置文件 S 需要哪些 wsdl 文件
- 无法打开源文件"sys/types.h"、"sys/stat.h"
- 传递自定义函数类型时的'incompatible types in assignment'
- SWIG INOUT types (C++ to Python)
- 尝试实施 PIMPL idom 时如何避免"redefinition; different basic types"
- 有人能解释一下特殊的std::函数模板参数列表语法(这个奇怪的类型(Types..))吗
- 当foo是接受单个模板参数的结构时,'foo<Type1, Types...>'是否合法?
- 为什么编译器显示错误"no match for 'operator[]' (operand types are 'carti' and 'int')"
- " invalid operands of types 'int' and 'int* const'" 来自功能的错误,来自书
- 字符串"companion types"
- 使用 getline() 时编译错误: 'mismatched types'
- Typedef redefinition with different types (Emscripten SDL2+O
- C++ gSOAP wsdl types