Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / October 2003

Tip: Looking for answers? Try searching our database.

How to redirect Remoting calls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Evans - 29 Oct 2003 23:39 GMT
Consider the following scenario:

Server A (running IIS + ASP.Net code)
----- firewall ----------------------
Server B (running .Net Remoting listener program)
----- firewall ----------------------
Servers C & D (also running .Net Remoting listener programs)

Due to firewall restrictions Server A is only allowed to talk to Server B
(not Server C or D).  Servers C & D host the actual business objects.
I can send Remoting calls from Server A to Server B no problem.  I am trying
to find a way for Server B to redirect the calls to Servers C & D, and pass
the results back to Server A.  In other words, I want Server B to act like a
.Net Remoting proxy.

Roman Kiss has written an IMessageSink that can act as a re-router for
Remoting calls (see
http://www.codeproject.com/csharp/chainingchannels.asp?target=chaining ) and
this looks very good.  Unfortunately I think this only works for Server
Activated Objects.  I need a solution for Client Activated Objects.

Any ideas on how this might be achieved gratefully received.

Peter Evans.
Wray Smallwood - 30 Oct 2003 05:55 GMT
I did it in a large project for the same reasons as you. However I didn't
use any magic proxy bullets. Server B is simply both a remoting server and a
remoting client. It passes object forward by invoking the identical named
methods on server C&D using the objects if receives. Likewise it returns the
object it was supposed to from Server C&D to Server A.  In some cases it was
necessary for Server B to do some additional work and call a different
remote method and it did so. The delay time for small objects was not
noticeable to an interactive client waiting for something.

Wray

It is in the 10's of lines of code, just a method matching method
> Consider the following scenario:
>
[quoted text clipped - 20 lines]
>
> Peter Evans.
Peter Evans - 30 Oct 2003 21:36 GMT
Thanks Wray, that's interesting.  Let me see if I understand you correctly.

For every class on ServerC and ServerD that I want to expose remotely, I
need to write a wrapper class.  The wrapper class is just a simple
pass-through for every method in the class.  I install the wrapper class on
ServerB.  I configure ServerB to be a server of this wrapper class, and a
client of the real class.  The client code (running on ServerA) will need to
change to create instances of the wrapper class.  The client will be
configured to remote this class to ServerB.

So, for example, when the client creates an instance of ClassCWrapper this
will be remoted to ServerB.  An instance of ClassCWrapper is created on
ServerB.  In turn this creates an instance of ClassC.  This is remoted to
ServerC, which creates an instance of ClassC.  The object reference to this
ClassC instance is passed back to ServerB.  The object reference to the
ClassCWrapper is passed back to the client.  The client can now make method
calls on this object reference, which will be remoted to ServerB, which will
in turn call methods on its object reference, which will be remoted to
ServerC.

Phew!!  Hopefully I got all that right.  I understand how this could work,
and it is an acceptable solution in my case.  I am still hoping to find some
way to remove the wrapper class from the solution altogether.  Ideally I
want ServerB to be a remoting server for ClassC as well as a remoting client
for ClassC.  This would mean that ServerB.exe wouldn't need to have ANY
knowledge of the classes it is serving (other that in its .config file).  I
tried configuring it that way but couldn't get it to work.

Thanks for your reply
Peter

> I did it in a large project for the same reasons as you. However I didn't
> use any magic proxy bullets. Server B is simply both a remoting server and a
[quoted text clipped - 36 lines]
> >
> > Peter Evans.
Roman Kiss - 30 Oct 2003 17:30 GMT
Peter,

have a look at my article "Using WSE-DIME for Remoting over Internet"
[1]. I am using the WSE-DIME feature to pass the remoting message
(IMessage) over the Internet into the target remoting infrastructure.
Of course, your servers B,D have to install this web service. The
design pattern between the remoting object and its consumer is full
transparently.

HTH

Roman

[1] http://www.codeproject.com/cs/webservices/remotingdime.asp


> Consider the following scenario:
>
[quoted text clipped - 20 lines]
>
> Peter Evans.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.