J
Joe
I have a web service which returns many types (classes) to match the return
type. I want to cast the return type to the actual class type.
For example:
namespace Test
{
class MyClass
{
...
}
}
[WebMethod]
public MyClass Test();
the proxy will be a deserialized version of MyClass but under the namespace
of the generated proxy.
I would like to do something like this:
MyClass myClass = webService.Test();
This of course won't work because the cast fails.
Then I thought of creating another proxy in the lib were MyClass is defined
and add a constructor which takes the proxy MyClass. BUT, the new proxy now
falls under another namespace and again fails.
I than thought of using one proxy for both instances (the calling app and
the lib) but this isn't really practical.
I also thought of using the Convert.ToType but that means the generated
proxy needs to implement IConvertible.
Are there any suggestions on how to handle this?
Thanks,
Joe
type. I want to cast the return type to the actual class type.
For example:
namespace Test
{
class MyClass
{
...
}
}
[WebMethod]
public MyClass Test();
the proxy will be a deserialized version of MyClass but under the namespace
of the generated proxy.
I would like to do something like this:
MyClass myClass = webService.Test();
This of course won't work because the cast fails.
Then I thought of creating another proxy in the lib were MyClass is defined
and add a constructor which takes the proxy MyClass. BUT, the new proxy now
falls under another namespace and again fails.
I than thought of using one proxy for both instances (the calling app and
the lib) but this isn't really practical.
I also thought of using the Convert.ToType but that means the generated
proxy needs to implement IConvertible.
Are there any suggestions on how to handle this?
Thanks,
Joe