If you return an enum type from a webservice, the enum type appears in the
client-side generated proxy.
Eg, if this is my asmx:
<%@ WebService Language="C#" Class="TrialService" %>
public enum MyEnum {
Blue,
Green,
Yellow,
Red
}
[System.Web.Services.WebService(Namespace="http://dinoch.dyndns.org/webservi
ces/")]
public class TrialService {
static System.Random rnd= new System.Random();
[System.Web.Services.WebMethod(Description="Method that returns an enum")]
public MyEnum Method2(int input) {
System.Array a= System.Enum.GetValues(typeof(MyEnum));
MyEnum result= (MyEnum) System.Enum.Parse(typeof(MyEnum),
rnd.Next(a.Length).ToString());
return result;
}
}
Then if I run wsdl.exe on that asmx, I get
/// <remarks/>
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://dinoch.dyndns.o
rg/webservices/")]
public enum MyEnum {
/// <remarks/>
Blue,
/// <remarks/>
Green,
/// <remarks/>
Yellow,
/// <remarks/>
Red,
}
in the client-side proxy.
-Dino
> Hi,
>
[quoted text clipped - 22 lines]
> Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...