wcfbiztalkwebservice-clientbiztalk-2016

Enumerations in schemas using BizTalk WCF Service Publishing Wizard?


I am asked to publish a schema as WCF Service from BizTalk using BizTalk WCF Service Publishing Wizard, and to expose members as enumerations. Idea is to prohibit programmers to give wrong value in specific fields. I have defined the element type as string, with restriction and a set of values like so:

<xs:simpleType name="EventTypes">
  <xs:restriction base="xs:string">
    <xs:enumeration value="Created"/>
    <xs:enumeration value="Changed"/>
    <xs:enumeration value="Deleted"/>
  </xs:restriction>
</xs:simpleType>

However, generated client does not pick this up, and programmers are not prohibited to type other values because it is an unrestricted string variable.

Is there any way to publish WCF Service where generated client actually validates input?


Solution

  • Actually, this works, but something was cached/not re-genererated along the way...tricky. I was using Visual Studio to generate client, both when it didn't work and later when it worked.