0

我正在尝试为 JIRA 问题跟踪系统 WSDL 生成 gsoap 类。我运行这些命令来生成所需的类:

$ wsdl2h -o JIRASoap.h <url 到 wsdl>
$soapcpp2 -C JIRASoap.h

soapcpp2 命令给出以下输出,但没有说明如何修复它。

有错误:
3 语法错误
1 语义错误
2 个警告

这些是(大部分)错误:

JIRASoap.h(935):语法错误
JIRASoap.h(934):语法错误:输入之前;跳过
JIRASoap.h(940):语法错误
JIRASoap.h(939):语法错误:输入之前;跳过

JIRASoap.h(942):**错误**:__size 的重复声明(已在第 937 行声明)

JIRASoap.h(947):语法错误
JIRASoap.h(946):语法错误:输入之前;跳过

这是 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:错误:ISO C++ 禁止声明没有类型的“ArrayOf_USCORExsd_USCOREbase64Binary”

以下是 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”。

4

1 回答 1

0

我设法通过从 JIRASoap.h 中删除对 ArrayOf_USCORExsd_USCOREbase64Binary 的所有引用来编译代码,包括类本身和 ns4_addAttachmentsToIssue 方法(该方法将指向 ArrayOf_USCORExsd_USCOREbase64Binary 的指针作为参数)。

如果您找到了在不删除 ns4_addAttachmentsToIssue 的情况下修复上述错误的方法,请告诉我。

于 2009-08-19T19:26:18.513 回答