How to generate proxy for a child class when my web service return a parent class?
- by Amir Borzoei
Hi *
I have a web method like this:
public class ParentClass{
public String str1;
}
public class ChildClass : ParentClass{
public String str2;
}
public class WebService{
public ParentClass WebMethod(){
return GetFirstChildClass(); //Return a child class
}
}
When I generate proxy for this web service by Visual Studio, VS just generate proxy for ParentClass but I need ChildClass too. For workaround I add a dummy method to WebService that return ChildClass to generate proxy for ChildClass in client.
public class WebService{
...
//This is a dummy method to generate proxy for ChildClass in client.
public ChildClass DummyWebMethod(){
return null;
}
}
In addition I write web service in java (JAX-WS) and my client is a SilverLight Application.
Is there a better solution for this problem?
tanx for your help ;)