I have 3 different web services work with same class library. These three web services return same class type object. But on the client side, I’m getting 3 different object type even they are same. I can’t treat them like one class type.
I think i will add a method which can take object and sets properties with object’s props.
Is there any way (somethin like inheritance) ?
You can use the wsdl.exe tool (this is what Visual Studio does for web references behind the scenes) and pass the
/shareTypesparameter. As long as the types returned by the 3 web services are really the same type, the generated code will contain just one generated class instead of duplicating it for each web service.