Re: What classes do I use to create a web proxy
- From: "Alberto Poblacion" <earthling-quitaestoparacontestar@xxxxxxxxxxxxx>
- Date: Fri, 9 May 2008 15:59:07 +0200
Take a look at the System.Net.Sockets namespace.
You could use a TcpListener object to listen for requests from the desktop application, and a TcpClient (or easier: a WebRequest object) to connect to the original web server.
However, there might be an easier way: You could use an asp.net application hosted in IIS to receive the requests from your client. An Http Handler in your application would process all requests, and use the WebClient class to send the same requests to the original webserver. This would save you from programming all the multithreading that you would need to add into your code if you were using a TcpListener to process mutiple client requests.
You say that you "do not want to create a web service proxy nor do I want to do anything with web services". However, this route that you don't want to follow might be the easiest of them all. If all the requests from your desktop client are calls into a web service, you can probably, with a bit of work, use asp.net web services to emulate the services in the original server, and also use the web service client in .Net to call into the server.
"Peter" <pepaltavista@xxxxxxxxxxx> wrote in message news:27fcdd18-2d14-4a6f-ac32-8435ab2ead32@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Firstly let me be very clear about this, I do not want to create a web
service proxy nor do I want to do anything with web services.
Basically, I have a shrink wrapped desktop application which downloads
data from a web site. Unfortunately the application has a fixed
timeout and the web server regularly exceeds this, causing the
application to shut the connection and subsequently not receive any
data. The desktop application also uploads data to the web server but
this does not suffer from timeout problems.
Changing the desktop or web serve application is not an option.
So I need to create a lightweight proxy that can sit between the
desktop and web server applications. The proxy needs to operate in 3
modes. The 1st mode would download the data from the web server to
persistent storage and the 2nd mode of the proxy would serve this data
from persistent storage to the desktop application. To complicate
matters a little more, the 3rd mode must be able to operate as a
transparent proxy, merely accepting the data fromthe desktop
application and passing it on to the web server.
So I think that I simply need to be able to request the data from the
web server and provide a web server interface to the desktop
application. I know how to do this quickly in Java but have no idea
where to start with dotnet. The documentation in MSDN is somewhat
overwhelming at the moment.
Can anyone please give me a pointer to the classes that I would need
to do this. Of course I may also be off target here, so if I need to
use Visual C++ instead of C#, then please point that out.
TIA, Peter
.
- Follow-Ups:
- Re: What classes do I use to create a web proxy
- From: Peter
- Re: What classes do I use to create a web proxy
- References:
- What classes do I use to create a web proxy
- From: Peter
- What classes do I use to create a web proxy
- Prev by Date: Re: How best can I create a panel which allows zoom on a drawing?
- Next by Date: Re: How to access a run time generated PictureBox on the form
- Previous by thread: What classes do I use to create a web proxy
- Next by thread: Re: What classes do I use to create a web proxy
- Index(es):
Relevant Pages
|