Simulating Server.Transfer to another machine

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I need to do the logical equivelent of Server.Transfer to another
server whos identity is known only upon receipt of the request. (The
other machine is on-site, but not addressable from the outside world,
which is one of many reasons I can't do a Redirect.)
I'm assuming I have to make another request, and then copy the response
back to the original response. What is the most efficient way of doing
this? (All servers are IIS/Asp.Net.)
thanks,
m
 
Ick. Sounds like an unfortunate problem. What sort of information is the
second server providing? Does it have to be presented as HTML?

Can you instead design your app such that you get back XML (such as a web
service) from the second server, instead of HTML? So then your first server
is really the one rendering the page to the client based upon the XML data
provided by the second? I think this will make things smoother for you in
the long run.

If not then you can use HttpWebRequest class to issue a HTTP request to the
second server and use HttpWebResponse to handle the results.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
I'm assuming I have to make another request, and then copy the response
back to the original response. What is the most efficient way of doing
this? (All servers are IIS/Asp.Net.)

Seems like you may have to do a HTTPWebRequest... basically screen
scraping.

Here is more info:

http://aspnet.4guysfromrolla.com/articles/122204-1.aspx

Or could your internal app be exposed as a web service? That way the
external server can make remoting or web service calls to the back end
server to fetch the appropriate information.
 
Brock Allen said:
Ick. Sounds like an unfortunate problem. What sort of information is the
second server providing? Does it have to be presented as HTML?

It's partially binary (which is why I don't want to use a web-svc and
base-64 everything) -- -- target is not a browser in this case, but I'm
using http:80 for other reasons. This is basically akin to a load-balancing
problem.
It must be a pretty common problem to solve, because I assume that's what
all those expensive magic switches (f5, Cisco, etc.) do that route your
request to an ostensibly available server, but always re-route the same
session back to the same server.

thanks,
m
 
Back
Top