I am referencing a WCF service from my orchestration and one of the generated XSD files the enum is defined as:
<xs:element name=”OLI_LU_IDREFTYPE” nillable=”true” type=”tns:OLI_LU_IDREFTYPE” />
<xs:simpleType name=”OLI_LU_PARTY”>
<xs:restriction base=”xs:string”>
<xs:enumeration value=”Person”>
<xs:annotation>
<xs:appinfo>
<EnumerationValue xmlns=”http://schemas.microsoft.com/2003/10/Serialization/”>1</EnumerationValue>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
I then call the service and if I send the retrieved message out I get this in the message:
<ns2:PartyTypeCode>Person</ns2:PartyTypeCode>
Where the Person value is the value in the enumeration, but it’s the string value. I’d like to able to map both the string value as well as the integer value of the enumeration. Any ideas how I can cast it to the integer value (i.e. in C# I would do this
int personId = (int)p.PartyTypeCode;
Thanks.