468,554 Members | 1,958 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,554 developers. It's quick & easy.

Q: Proxy in The Middle

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

Nov 15 '05 #1
3 1994

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" <so********@antisocial.com>
| From: "Soul" <no@spam.com>
| 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: <uO**************@TK2MSFTNGP11.phx.gbl>
| 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!TK2MSFTN GP11.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
|
|
|
|

Nov 15 '05 #2
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
"Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
news:sv**************@cpmsftngxa06.phx.gbl...
|
| 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" <so********@antisocial.com>
| | From: "Soul" <no@spam.com>
| | 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: <uO**************@TK2MSFTNGP11.phx.gbl>
| | 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!TK2MSFTN GP11.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
| |
| |
| |
| |
|

Nov 15 '05 #3

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...b;en-us;318140
http://support.microsoft.com/default...b;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" <so********@antisocial.com>
| From: "Soul" <no@spam.com>
| References: <uO**************@TK2MSFTNGP11.phx.gbl>
<sv**************@cpmsftngxa06.phx.gbl>
| 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: <Ob*************@TK2MSFTNGP10.phx.gbl>
| 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!TK2MSFTN GP10.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
|
|
| "Jeffrey Tan[MSFT]" <v-*****@online.microsoft.com> wrote in message
| news:sv**************@cpmsftngxa06.phx.gbl...
| |
| | 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" <so********@antisocial.com>
| | | From: "Soul" <no@spam.com>
| | | 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: <uO**************@TK2MSFTNGP11.phx.gbl>
| | | 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!TK2MSFTN GP11.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
| | |
| | |
| | |
| | |
| |
|
|

Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Glauco | last post: by
3 posts views Thread by Muhammad Ali | last post: by
16 posts views Thread by Paul Sweeney | last post: by
4 posts views Thread by Fuzzyman | last post: by
reply views Thread by Iker Arizmendi | last post: by
reply views Thread by George Bool | last post: by
2 posts views Thread by Robin Haswell | last post: by
5 posts views Thread by Gary | last post: by
5 posts views Thread by =?Utf-8?B?TWFyaw==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.