[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Stewart Stevens

10/22/2004 4:22:00 AM

I'm trying to implement a custom RealProxy.

In my Invoke method I'm unsure of the correct way of dispatching the
message.

The msdn documentation sample uses
ChannelServices::SyncDispatchMessage(msg);

I try this with the __Uri message property set to the URI obtained from the
objRef URI property as obtained by RemotingServices::Marshal on my remote
MarshalByRef derived subject. Also I have tried String::Concat on the Uri
with the server uri and server uri + application name. The really long
magic uri from ObjRef appears to exactly match the URI on the server
object......BUT in all cases I get a RemotingException thrown from
SyncDispatchMessage that says the object doesn't exist or has been
disconnected. (The object is definitely still there.)

I have also been looking at the MSDN TV thing done by Douglas Purdy and in
his example he uses
RemotingServices::ExecuteMessage(...);

When I try this I get a RemotingException saying that "ExecuteMessage can be
called only from the native context of the object." Now this just seems
crazy to me as the native context (as poorly as I understand what a context
is) resides on the server and the code in the proxy is on the client and
has to be.

So which is the right way of doing it?....any ideas what's causing the
errors? One thing that I am slightly jittery about is that intializing the
RealProxy means calling GetType on the remote object reference. I have a
seperate dll that provides all my remote interfaces and the client doesn't
see any of the server side, MarshalByRef derived objects directly. I have
tried adding a GetType override to my remote interface....(see bug 320347)
this doesn't seem to help.

I'd really appreciate any help / advice.