2
我使用Web服務使用正數和負數來指示Web服務調用是否成功,如果不是,則數字指示錯誤的類型。使用WSDL導入程序(在Delphi 2007,Delphi 2010和Delphi XE中),我得到這種類型定義:具有負數的枚舉類型的WSDL導入程序
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>
WSDL Importer對這些情況不使用良好的默認名稱,但只要您保持「RegisterExternalPropName」調用爲最新,您可以根據需要更改它們。例如,分別將'_12'更改爲'One'和'_7',並更新相應的RegisterExternalPropName調用。本機成員名稱與服務無關 - 只有在XML中生成的外部名稱很重要。 – BruneauB 2011-03-14 20:00:41
謝謝你們的幫助。改變單位底部的註冊電話也有訣竅。 – 2011-03-20 23:35:30