【问题标题】:gsoap class generation problemgsoap 类生成问题
【发布时间】:2009-08-19 17:29:32
【问题描述】:

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

$ wsdl2h -o JIRASoap.h 
$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”。

【问题讨论】:

    标签: xml wsdl gsoap


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-07
      • 2013-11-03
      • 2011-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多