G
Guest
I have a class library, lets call it ClassLib, which contains an abstract
class, lets call it Entity, that acts as sort of a marker.
I have a web service that consumes the ClassLib to make use of the Entity
abstract class. The web service has a class, lets call it MyEntity that
inherits from ClassLib.Entity and a method called GetEntitites that returns
an array of MyEntity classes.
Next I have a web application that consumes the web service. Of course the
reference to the web services makes a proxy classes called Entity and
MyEntity. The problem is that these types are NOT the same types as the web
service referenced therefore when the GetEntities method is called it returns
the array of MyEntity objects as defined by the proxy.
This is all well and expected. I understand all of what I just explained.
Now here comes my question...
How can I convert each of the MyEntity objects returned from the web service
into the original type that the web serviced used from the ClassLib?
NOTE: I do not want to change anything in the references.cs file of the
reference to the web service.
I looked at the System.ComponentModel.TypeConverter class but that just
doesn't work. Casting doesn't work as well. Any ideas?
class, lets call it Entity, that acts as sort of a marker.
I have a web service that consumes the ClassLib to make use of the Entity
abstract class. The web service has a class, lets call it MyEntity that
inherits from ClassLib.Entity and a method called GetEntitites that returns
an array of MyEntity classes.
Next I have a web application that consumes the web service. Of course the
reference to the web services makes a proxy classes called Entity and
MyEntity. The problem is that these types are NOT the same types as the web
service referenced therefore when the GetEntities method is called it returns
the array of MyEntity objects as defined by the proxy.
This is all well and expected. I understand all of what I just explained.
Now here comes my question...
How can I convert each of the MyEntity objects returned from the web service
into the original type that the web serviced used from the ClassLib?
NOTE: I do not want to change anything in the references.cs file of the
reference to the web service.
I looked at the System.ComponentModel.TypeConverter class but that just
doesn't work. Casting doesn't work as well. Any ideas?