DMitchell wrote:
Is there any way of getting a public enumeration to be generated into
a web service proxy?
This works for me:
<codeSnippet language="C#">
[Flags]
public enum TestEnum
{
None = 0,
Value1 = 1,
Value2 = 2
}
[WebMethod]
public TestEnum ReturnEnum()
{
return TestEnum.None;
}
</codeSnippet>
It generates the following Schmea within the WSDL:
<s:simpleType name="TestEnum">
<s:list>
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="None" />
<s:enumeration value="Value1" />
<s:enumeration value="Value2" />
</s:restriction>
</s:simpleType>
</s:list>
</s:simpleType>
Which the proxy generator seems to parse just fine. I end up with the same
enum on the client. Also beware that the values will not be the same, but
they don't need to be since the enum name is all that matters in the realm
of XML.
HTH,
Dre