Q: Proxy in The Middle

S

Soul

Hi,

I am learning to code a WinForm application which will need to access a Web
Service outside the University network. Our University require us to go
through a proxy in order to access the Internet. In addition, the proxy
require us to authenticated before allow us to go through it.

I have coded something like below (without changing anything other things):

WebProxy proxyObject = new WebProxy("proxy.myUni.edu.au", 8080); //
Without "http://"
proxyObject.BypassProxyOnLocal = true;
proxyObject.Credentials = new NetworkCredential("myUserName",
"myPassword");
this.myWebService.Proxy = proxyObject;

myWebService.DatabaseQueryFunction("aString", anInt);

It run perfectly when I tried without coding to use proxy and run the
application at home. Unfortunately, when I run the application in the
University and modify the code to use proxy; whenever calling the webservice
function, the application will get "Time Out" error. I am pretty sure it
found the proxy server because I can see "proxy.myUni.edu.au 8080 TIME_WAIT"
by using netstat command.

Anyone know is there anything wrong with my code?

Thank you.
 
J

Jeffrey Tan[MSFT]

Hi Soul,

If you just set the proxy.myUni.edu.au:8080 in the Internet Explorer's
proxy setting, can you access the Web site that expose the web service?
I think you also can try to modify your application, not use the proxy to
visit the web service, but just use WebBrowser control(or IE component) to
visit this web site through this WebProxy class to test whether you can
use the WebProxy.

You also can try to add http:// to the constructor of WebProxy, if this
takes effect?

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Reply-To: "Soul" <[email protected]>
| From: "Soul" <[email protected]>
| Subject: Q: Proxy in The Middle
| Date: Thu, 9 Oct 2003 17:47:14 +1000
| Lines: 34
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="utf-8"
| Content-Transfer-Encoding: 7bit
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl-203-113-216-2.vic.netspace.net.au 203.113.216.2
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:190150
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| I am learning to code a WinForm application which will need to access a
Web
| Service outside the University network. Our University require us to go
| through a proxy in order to access the Internet. In addition, the proxy
| require us to authenticated before allow us to go through it.
|
| I have coded something like below (without changing anything other
things):
|
| WebProxy proxyObject = new WebProxy("proxy.myUni.edu.au", 8080); //
| Without "http://"
| proxyObject.BypassProxyOnLocal = true;
| proxyObject.Credentials = new NetworkCredential("myUserName",
| "myPassword");
| this.myWebService.Proxy = proxyObject;
|
| myWebService.DatabaseQueryFunction("aString", anInt);
|
| It run perfectly when I tried without coding to use proxy and run the
| application at home. Unfortunately, when I run the application in the
| University and modify the code to use proxy; whenever calling the
webservice
| function, the application will get "Time Out" error. I am pretty sure it
| found the proxy server because I can see "proxy.myUni.edu.au 8080
TIME_WAIT"
| by using netstat command.
|
| Anyone know is there anything wrong with my code?
|
| Thank you.
|
| --
| Soul
|
|
|
|
 
S

Soul

Hi Jeffrey,

Yape, I can access the .asmx file directly from the browser (IE) without any
problem if I enter the correct username and password when it ask for.
Moreover, I also able to successfully invoke those exposed function
correctly. I also have tried to include "http://" in front of the proxy
address, but problem still exist.

Actually, I'm consider very new to programming. I can't really understand
what you mean by WebBrowser control. I can't find the control in the
toolbox. But if I:

* Right click on the toolbox in VS.Net
* Select "Add/Remove"
* Select "Com Components" tab

I am able to find something similar - Microsoft Web Browser - Version 1.1,
is this the one you mention? If yes, can you direct me to some resource on
how to use that control?

Thank you

--
Soul


|
| Hi Soul,
|
| If you just set the proxy.myUni.edu.au:8080 in the Internet Explorer's
| proxy setting, can you access the Web site that expose the web service?
| I think you also can try to modify your application, not use the proxy to
| visit the web service, but just use WebBrowser control(or IE component) to
| visit this web site through this WebProxy class to test whether you can
| use the WebProxy.
|
| You also can try to add http:// to the constructor of WebProxy, if this
| takes effect?
|
| Hope this helps,
|
| Best regards,
| Jeffrey Tan
| Microsoft Online Partner Support
| Get Secure! - www.microsoft.com/security
| This posting is provided "as is" with no warranties and confers no rights.
|
| --------------------
| | Reply-To: "Soul" <[email protected]>
| | From: "Soul" <[email protected]>
| | Subject: Q: Proxy in The Middle
| | Date: Thu, 9 Oct 2003 17:47:14 +1000
| | Lines: 34
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| | Message-ID: <[email protected]>
| | Newsgroups: microsoft.public.dotnet.languages.csharp
| | NNTP-Posting-Host: dsl-203-113-216-2.vic.netspace.net.au 203.113.216.2
| | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| | Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.languages.csharp:190150
| | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| |
| | Hi,
| |
| | I am learning to code a WinForm application which will need to access a
| Web
| | Service outside the University network. Our University require us to go
| | through a proxy in order to access the Internet. In addition, the proxy
| | require us to authenticated before allow us to go through it.
| |
| | I have coded something like below (without changing anything other
| things):
| |
| | WebProxy proxyObject = new WebProxy("proxy.myUni.edu.au", 8080); //
| | Without "http://"
| | proxyObject.BypassProxyOnLocal = true;
| | proxyObject.Credentials = new NetworkCredential("myUserName",
| | "myPassword");
| | this.myWebService.Proxy = proxyObject;
| |
| | myWebService.DatabaseQueryFunction("aString", anInt);
| |
| | It run perfectly when I tried without coding to use proxy and run the
| | application at home. Unfortunately, when I run the application in the
| | University and modify the code to use proxy; whenever calling the
| webservice
| | function, the application will get "Time Out" error. I am pretty sure it
| | found the proxy server because I can see "proxy.myUni.edu.au 8080
| TIME_WAIT"
| | by using netstat command.
| |
| | Anyone know is there anything wrong with my code?
| |
| | Thank you.
| |
| | --
| | Soul
| |
| |
| |
| |
|
 
J

Jeffrey Tan[MSFT]

Hi Soul,

It seems that this problem is documented in the Knoledge Base, you can
refer to the 2 links below to see if it resoves your problem:
http://support.microsoft.com/default.aspx?scid=kb;en-us;318140
http://support.microsoft.com/default.aspx?scid=kb;en-us;307220

Btw: the "Microsoft Web Browser" you find was just what I mentioned, it is
a component that expose the function similiar to the Internet Explorer.
I think you can use WebProxy to work with it to access the website that
expose the webservice.
To use this Web Browser control, you can just refer it members in the
"Object Browser" window.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Reply-To: "Soul" <[email protected]>
| From: "Soul" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Q: Proxy in The Middle
| Date: Sat, 11 Oct 2003 03:18:54 +1000
| Lines: 112
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="utf-8"
| Content-Transfer-Encoding: 7bit
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: dsl-203-113-220-14.vic.netspace.net.au 203.113.220.14
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:190610
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey,
|
| Yape, I can access the .asmx file directly from the browser (IE) without
any
| problem if I enter the correct username and password when it ask for.
| Moreover, I also able to successfully invoke those exposed function
| correctly. I also have tried to include "http://" in front of the proxy
| address, but problem still exist.
|
| Actually, I'm consider very new to programming. I can't really understand
| what you mean by WebBrowser control. I can't find the control in the
| toolbox. But if I:
|
| * Right click on the toolbox in VS.Net
| * Select "Add/Remove"
| * Select "Com Components" tab
|
| I am able to find something similar - Microsoft Web Browser - Version 1.1,
| is this the one you mention? If yes, can you direct me to some resource on
| how to use that control?
|
| Thank you
|
| --
| Soul
|
|
| | |
| | Hi Soul,
| |
| | If you just set the proxy.myUni.edu.au:8080 in the Internet Explorer's
| | proxy setting, can you access the Web site that expose the web service?
| | I think you also can try to modify your application, not use the proxy
to
| | visit the web service, but just use WebBrowser control(or IE component)
to
| | visit this web site through this WebProxy class to test whether you can
| | use the WebProxy.
| |
| | You also can try to add http:// to the constructor of WebProxy, if this
| | takes effect?
| |
| | Hope this helps,
| |
| | Best regards,
| | Jeffrey Tan
| | Microsoft Online Partner Support
| | Get Secure! - www.microsoft.com/security
| | This posting is provided "as is" with no warranties and confers no
rights.
| |
| | --------------------
| | | Reply-To: "Soul" <[email protected]>
| | | From: "Soul" <[email protected]>
| | | Subject: Q: Proxy in The Middle
| | | Date: Thu, 9 Oct 2003 17:47:14 +1000
| | | Lines: 34
| | | MIME-Version: 1.0
| | | Content-Type: text/plain;
| | | charset="utf-8"
| | | Content-Transfer-Encoding: 7bit
| | | X-Priority: 3
| | | X-MSMail-Priority: Normal
| | | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| | | Message-ID: <[email protected]>
| | | Newsgroups: microsoft.public.dotnet.languages.csharp
| | | NNTP-Posting-Host: dsl-203-113-216-2.vic.netspace.net.au 203.113.216.2
| | | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| | | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:190150
| | | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| | |
| | | Hi,
| | |
| | | I am learning to code a WinForm application which will need to access
a
| | Web
| | | Service outside the University network. Our University require us to
go
| | | through a proxy in order to access the Internet. In addition, the
proxy
| | | require us to authenticated before allow us to go through it.
| | |
| | | I have coded something like below (without changing anything other
| | things):
| | |
| | | WebProxy proxyObject = new WebProxy("proxy.myUni.edu.au", 8080);
//
| | | Without "http://"
| | | proxyObject.BypassProxyOnLocal = true;
| | | proxyObject.Credentials = new NetworkCredential("myUserName",
| | | "myPassword");
| | | this.myWebService.Proxy = proxyObject;
| | |
| | | myWebService.DatabaseQueryFunction("aString", anInt);
| | |
| | | It run perfectly when I tried without coding to use proxy and run the
| | | application at home. Unfortunately, when I run the application in the
| | | University and modify the code to use proxy; whenever calling the
| | webservice
| | | function, the application will get "Time Out" error. I am pretty sure
it
| | | found the proxy server because I can see "proxy.myUni.edu.au 8080
| | TIME_WAIT"
| | | by using netstat command.
| | |
| | | Anyone know is there anything wrong with my code?
| | |
| | | Thank you.
| | |
| | | --
| | | Soul
| | |
| | |
| | |
| | |
| |
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top