【发布时间】:2011-03-14 17:52:56
【问题描述】:
我使用一个 Web 服务,它使用正数和负数来指示 Web 服务调用是否成功,如果不成功,则数字指示错误类型。使用 WSDL 导入器(在 Delphi 2007、Delphi 2010 和 Delphi XE 中),我得到了这个类型定义:
PCRUpdateCodes = (_7, _6, _5, _4, _3, _2, _1, _1, _2, _3, _4);
在 WSDL 中,右边的最后四个条目是负数。 Delphi 编译器给我最后四个条目的错误“标识符重新声明”。如何使最后四个条目为负数?
这是 WSDL 的相关部分。
<xs:simpleType name="PCRUpdateCodes">
<xs:annotation>
<xs:documentation>Codes to describe return codes for an attempted PCR import web service operation</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:integer">
<xs:enumeration value="-7">
<xs:annotation>
<xs:documentation>Permission denied to the client for that organization</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="-6">
<xs:annotation>
<xs:documentation>Permission denied to the client for the operation</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="-5">
<xs:annotation>
<xs:documentation>Invalid username and/or password</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="-4">
<xs:annotation>
<xs:documentation>Failed update of PCR, because no PCR exists with the same agency # and PCR #</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="-3">
<xs:annotation>
<xs:documentation>Failed update of PCR marked incomplete, because PCR was previously marked complete</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="-2">
<xs:annotation>
<xs:documentation>Failed update of PCR, because of failing NEMSIS XML validation</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="-1">
<xs:annotation>
<xs:documentation>Failed update of PCR marked complete, because of failing logical validation</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="1">
<xs:annotation>
<xs:documentation>Successful update of PCR marked incomplete, but failing logical validation</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="2">
<xs:annotation>
<xs:documentation>Successful update of PCR marked incomplete</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="3">
<xs:annotation>
<xs:documentation>Successful update of PCR marked complete, previously marked incomplete</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="4">
<xs:annotation>
<xs:documentation>Successful update of PCR marked complete, previously marked complete, now marked amended</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="5">
<xs:annotation>
<xs:documentation>Successful update of PCR marked complete, previously marked incomplete, but with validation warnings</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="6">
<xs:annotation>
<xs:documentation>Successful update of PCR marked complete, previously marked complete, now marked amended, but with validation warnings</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
【问题讨论】: