Does my proxy implements myinterface ?

Hi,

Well, well.. i'm getting the first post at this forumSmile

Any help guys:

after doing


myobject = RemotingServices.Connect(typeof(MyClass), myUrl);


on a well known server activated, i want to test if


myObjectis IMyInterface


How can this be done, before calling anything on the object ?

Because even if it implements IMyInterface, i get a false value...

thanks!
HB

[933 byte] By [HugoBatista] at [2008-1-10]
# 1
Hugo Batista wrote:
Hi,

Well, well.. i'm getting the first post at this forum Smile

Any help guys:

after doing


myobject = RemotingServices.Connect(typeof(MyClass), myUrl);

on a well known server activated, i want to test if


myObject is IMyInterface

How can this be done, before calling anything on the object ?

Because even if it implements IMyInterface, i get a false value...

thanks!
HB

I dunno... Stick out tongue

Javier Luna
http://guydotnetxmlwebservices.blogspot.com/

JavierLuna at 2007-8-20 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 2
Dear Hugo,

I'm afraid this isn't possible. For well-known proxies, there is no class hierarchy information contained within the proxy itself, since the proxy is generated on the fly (i.e., there is no remote call involved in the construction, and the client doesn't have the class hierarchy info).

For well-known proxies, we allow casting the proxy to any interface, but the invocation will fail once it hits the server if the server does not implement the interface.

Alternatively, client-activated objects do have full type fidality. With CAOs, casting / testing via "is" should work.

Thanks,
-mike

Program Manager
Distributed Systems Group
Microsoft Corporation

MikeVernal at 2007-8-20 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 3
I think you need to know in advance that the return object is of that type else you will not be able to case to the object and use it.

ka

KamranAmin at 2007-8-20 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified