473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

What classes do I use to create a web proxy

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
Jun 27 '08 #1
2 2495
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" <pe**********@yahoo.co.ukwrote in message
news:27**********************************@y38g2000 hsy.googlegroups.com...
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
Jun 27 '08 #2
On May 9, 2:59 pm, "Alberto Poblacion" <earthling-
quitaestoparacontes...@poblacion.orgwrote:
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" <pepaltavi...@yahoo.co.ukwrote in message

news:27**********************************@y38g2000 hsy.googlegroups.com...
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
The reason I say I don't want to use a webservice proxy is because
lately it seems whenever you mention anything about the internet,
people assume you are using webservices. Unfortunately in this case, I
am interfacing in to a legacy application that knows nothing about
webservices, it's a simple cgi.

As for a tcp listener, the desktop application makes a https call, so
I would not be able to use a simple tcp listener in this case as I
need to examine the packet coming in. I was hoping there was a
lightweight class for doing this, other than using IIS, which would
make it slightly more complicated for the non technical clients. Guess
I'll have to bite the bullet and use IIS after all, thanks for your
help.
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of different webservices. I don't use the webservices...
4
by: dbcuser | last post by:
Hi All, This is a very simple question. I have a proxy class (for web service) and couple of other classes that are common for 3 of my projects. As a developer, I would like to keep these common...
3
by: Chris Dunaway | last post by:
How can a class be shared between a web service and a client that consumes the web service? Suppose I have a Class Libraray with the following simple class: Public Class SimpleClass Private...
19
by: Charles Law | last post by:
Take a solution with a project hierarchy along the lines of an n-tier system, so that we have a data layer, business layer and presentation layer. The presentation layer is coupled to the business...
3
by: MIGUEL | last post by:
Hi all, I'm quite lost with how adding web references to a project creates proxy classes. I've developed a web service with two classes inside and that contains three references to three...
1
by: Steffen Heinzl | last post by:
Hi! Is it possible to invoke a web service with a client written in C# without generating proxy classes from the service's wsdl first? Apache Axis (for Java) provides a Call object which can...
9
by: yoni | last post by:
Hi All, I am using .net classes to download files over HTTP. in the old world, I would use WinInet, and the good think about that was that if the client was behind a proxy, it would already use IE...
4
by: =?Utf-8?B?Sm9l?= | last post by:
I have a .NET class library called NorthwindLib and a class called Customer. I have a web server that exposes a web method GetCustomer() and returns a NorthwindLib.Customer object. I want to...
2
by: Markjan | last post by:
I have a problem with classes and structures in classes (C++) I have to overload operator . class Data { public: class Proxy { //for overload operator Data& _a; int...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.