-1
我有一个asmx webservices的问题。我有那些对象继承:asmx webservice总是返回子类
public class animal
{
public string id = null;
public string name = null;
}
public class dog: animals
{
public string surname = null;
public string color = null;
}
和web服务
public animal GetAnimal()
{
animal result = new dog();
return result;
}
的问题是,我的web送花儿给人返回狗。有没有简单的方法,以便它可以返回动物? (我看见2个解决方案,我不喜欢:
animal result = new animal();
或
animal resultDog = new dog();
animal result = new animal();
result.id = resultDog.id
result.color = resultDog.color
)
您的代码使用webservice的样子是什么样的? – asawyer 2011-04-29 12:25:16