2009-08-19 55 views
0

我正在尝试为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”。

回答

0

我设法得到的代码通过从JIRASoap.h除去到ArrayOf_USCORExsd_USCOREbase64Binary所有参考文献,包括类本身和ns4_addAttachmentsToIssue方法(这需要一个指向ArrayOf_USCORExsd_USCOREbase64Binary作为参数)进行编译。

如果您找到了解决上述错误而不删除ns4_addAttachmentsToIssue的方法,请告诉我。