我正在嘗試爲JIRA問題跟蹤系統WSDL生成gsoap類。我運行這些命令來生成所需的類:gsoap類生成問題
$ wsdl2h -o JIRASoap.h <url to wsdl> $ soapcpp2 -C JIRASoap.h
的soapcpp2命令給出了下面的輸出,但沒有說明如何解決它。
There were errors: 3 syntax errors 1 semantic error 2 warnings
這些都是錯誤的(最):
JIRASoap.h(935): syntax error JIRASoap.h(934): Syntax error: input before ; skipped JIRASoap.h(940): syntax error JIRASoap.h(939): Syntax error: input before ; skipped JIRASoap.h(942): **ERROR**: Duplicate declaration of __size (already declarared at line 937) JIRASoap.h(947): syntax error JIRASoap.h(946): Syntax error: input before ; skipped
這裏是JIRASoap.h的相關部分(線928-947):
/// SOAP encoded array of xs:byte[]
class ArrayOf_USCORExsd_USCOREbase64Binary
{ public:
/// SOAP encoded array of xs:byte
class
{ public:
/// Pointer to array of xsd__byte.
xsd__byte *__ptr ;
/// Size of the dynamic array.
int __size ;
/// Offset for partially transmitted arrays (uncomment only when required).
// int __offset ;
} *__ptr ;
/// Size of the dynamic array.
int __size ;
/// Offset for partially transmitted arrays (uncomment only when required).
// int __offset ;
/// A handle to the soap struct that manages this instance (automatically set)
struct soap *soap ;
};
當我嘗試編譯我的程序,我得到這個錯誤:
soapStub.h:2799: error: ISO C++ forbids declaration of ‘ArrayOf_USCORExsd_USCOREbase64Binary’ with no type
這裏是WSDL的相關部分:
<complexType name="ArrayOf_xsd_base64Binary">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:byte[][]"/>
</restriction>
</complexContent>
</complexType>
據我所知,大多數種類在soapStub.h定義,但ArrayOf_USCORExsd_USCOREbase64Binary不是。
當我只生成C文件時,得到「struct/*?* /」而不是「ArrayOf_USCORExsd_USCOREbase64Binary」。