I'm using Delphi and I'm using a wsdl file from another company to set up my proxy class to use their data from their web service. The wsdl file contains the following:
<xsd:simpleType name="departStatus">
<xsd:annotation>
<xsd:documentation>Enumerates allowable departure statuses (DEPARTED, NOT-DEPARTED)</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="DEPARTED"/>
<xsd:enumeration value="NOT-DEPARTED"/>
</xsd:restriction>
</xsd:simpleType>
When I generate the proxy class I get the following:
departStatus = (
DEPARTED,
[System.Xml.Serialization.XmlEnumAttribute('NOT-DEPARTED')]
NOTDEPARTED);
Which doesn't compile unless I remove the line starting with [System.xml..., and it will not recognize "NOT-DEPARTED" as a valid value for departStatus. If I change "NOT-DEPARTED" to "NOT_DEPARTED" in the wsdl file and any incoming xml file it works fine, but the company that set this up is insisting that "NOT-DEPARTED" is valid and will not change it. Why isn't setting up the departStatus enumeration properly? Any ideas how to get around this? Thanks in advance for any help.
I have a possible workaround:
Since departStatus
is of the base type xsd:string
, you should be able to change all occurences of the departStatus
type to xsd:string
in the WSDL file.
That way you can pass/interpret the string 'DEPARTED'
or 'NON-DEPARTED'
instead of using an enum.
Delphi SOAP Runtime and Importer Update
http://cc.embarcadero.com/Item/24535
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With