Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Accessing Webservice from behind a Proxy
macz
#1 Posted : Friday, June 15, 2007 2:58:57 AM(UTC)
Groups: Member
Joined: 6/15/2007(UTC)
Posts: 3

Hi all,

I am running a webservice on Cassini and all works fine
- until I try to reach this service from a c# program through a Proxy (in my case Squid on Windows)
In this case my code is throwing a WebException "Connection closed".

When hosted on IIS the same service is reachable through the Proxy with no problems.

Any hints or suggestions?

macz
Ultidev Team
#2 Posted : Friday, June 15, 2007 4:36:43 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi, Macz.

This is not one of the known issues. We regularly use HTTP tracers like Fiddler, which acts as an HTTP proxy, and never had a problem.

Since you are reaching IIS with no problem we assume your code is alright, but in order to be able to troubleshoot this issue we would like to ask you a few questions:
- Are you also unable to reach the site running under Cassini through the proxy using the browser, or problem is limited to C# program client?
- Is your web service C# client a windows application or web application?
- Do you set "request.Proxy = new WebbProxy(...)" manually or you are relying on WinInet to set the value of the "request.Proxy" automatically?

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
macz
#3 Posted : Friday, June 15, 2007 6:09:04 AM(UTC)
Groups: Member
Joined: 6/15/2007(UTC)
Posts: 3

Ultidev Team wrote:

- Are you also unable to reach the site running under Cassini through the proxy using the browser, or problem is limited to C# program client?


I can reach the descriptive Pages but I can't invoke a method

Ultidev Team wrote:

- Is your web service C# client a windows application or web application?


windows application (for testing purposes - the final version should run in a windows ce 5.0 application on a PDA)

Ultidev Team wrote:

- Do you set "request.Proxy = new WebbProxy(...)" manually or you are relying on WinInet to set the value of the "request.Proxy" automatically?


I did it manually with:
service.Proxy = new WebProxy("<proxyURL>");

thx for your help!

Best regards,
UltiDev Team.[/quote]
Ultidev Team
#4 Posted : Friday, June 15, 2007 11:25:42 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi!

It's a little hard for us to make sense of what's going on, because if it was a connectivity issue, then you wouldn't be able to access the ASMX from browser.

Could you please try a couple of things to help us troubleshoot this:
- Comment out "service.Proxy = new Proxy(..." line and set the HTTP Proxy settings in Internet Explorer Properties on the client machine. This will make your windows application pick default system HTTP Proxy settings from the WinInet. In this case if your browser is able to reach ASMX, then chances are your WS client will too. If you get the same result as before this will eliminate your client as a culprit.

- If that does not help, we'd recommend using Fiddler to trace requests/response sessions between client and the service without HTTP Proxy in place. Fiddler when it runs, inserts itself as a default system HTTP proxy into WinInet (your can verify that in IE Connection Properties when Fiddler runs) and therefore would be helpful as both tracing tool and HTTP Proxy emulator. Fiddler will show you what's exactly is being sent over the wire. If it works with Fiddler but not qith Squid, then we'll need to go do more tracing to find out who's the bad guy.

- Third, to ensure that nothing is wrong with the service itself causing it to close the connection, please create a client for the web service provided by Cassini Explorer, which can be found at http://server:7756/CassiniConfigurationService.asmx where "server" is the host name of the machine running UltiDev Cassini. If you experience the same issue with our service as with yours, it will eliminate the service as a culprit.

Please let us know about the results.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
macz
#5 Posted : Saturday, June 16, 2007 1:40:53 AM(UTC)
Groups: Member
Joined: 6/15/2007(UTC)
Posts: 3

Ultidev Team wrote:
Hi!

It's a little hard for us to make sense of what's going on, because if it was a connectivity issue, then you wouldn't be able to access the ASMX from browser.


So it is for me ;) but I am pretty sure that I have excluded the connectivity issues (normal ASP.net pages provided by the same cassini come through fine)

Unfortunatly this problem is part of a project-in-progress with a tight schedule. We are running several identical server (each collecting data from a industrial assembly line) providing the same service with different data to PDAs which are each connected to one server via a WLan Access-Point bound to his own network-device. The server are connected through the enterprise-Lan, but no traffic from the WLans is allowed to reach the enterprise-Lan (what wasn't nessesary, cause the PDAs needed only to know about the status of the single server they were connected to).

But now the need arised for PDAs fetching data from an adjacent server, i.e. looking for what's going on on their neighbouring assembly lines . We came up with the idea to let a proxy (installed on each server) do the requests for the PDAs, decoupling the two networks (WLans and enterprise Lan). Cause this didn't worked as expected, I abondoned the proxy and extended the signatures of the webservice-methods with a "serverToAsk"-variable, enabling the webservice to use the webservices of his sibblings. (which isn't the smartest solution at all, but work's fine).

Nonetheless I am very gracefull for your suggestions - I will follow them and let you know the results. Until now I used Ethereal and the logfiles of the proxy to check my network-traffic, I hope Fiddler will bring some better insights!

macz
Ultidev Team
#6 Posted : Saturday, June 16, 2007 5:08:56 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Macz,

Please let us know if we can help. We will do our best to help you find the solution.

If you have access to HTTP Proxy logs you should be able to tell in which segments of the trip the connection closed occurs: between client and HTTP Proxy, or between Proxy and Cassini.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.