473,480 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Proxy Authentication Required using VS2005

rcp
Hi all,
I've read all posts from all existing threads and none of them worked
to solve my problem, although its exactly the same. I'll try to
explain my case and see if a kind soul could help me out:

I've a win32 service in C# on a client machine A, which accesses a WS
(C#) on a server machine B (hosted on an IIS)

Case 1:
If I try to add the WSDL for the WS through VS2005, the 'Discovery
Credentials for proxy server' pops up, and whatever user and pwd with
rights to get through is not working.

error:
-------------
There was an error downloading 'http://xxxx'.
Unable to connect to the remote server
-------------

Case 2:
I try to add the WSDL for the WS through WSDL.EXE, using proxy
user-password-domain on the command prompt, but I get the following
error.

wsdl /l:cs /n:ContentHost2/proxy:nnn.nnn.nnn.nnn:8080
/proxydomain:xxx.xx /proxypassword:aaaaaaa /proxyuse
rname:bbbbbb /o:d:\
http://aaa.bbb.ccc.ddd:8080/WebPorta...ices/WebServic
e1.asmx?wsdl

error:
-----------------
Error: There was an error processing
'http://aaa.bbb.ccc.ddd:8080/WebPortal/WebSer
vices/WebService1.asmx?wsdl'.
- There was an error downloading
'http://aaa.bbb.ccc.ddd:8080/WebPortal/WebServi
ces/WebService1.asmx?wsdl'.
- The request failed with HTTP status 407: Proxy Authentication
Required.

Case 3:
I use the WS created on my development machine (with its own IIS),
adding the WSDL as a web reference through VS2005.
It works.
On the win32 service config file, I configure it to use the service
hosted on Machine B (the one outside my domain, and needing a proxy to
get out.
I debug the service.
It instantiates the WS with no problem on a global variable, reading
the WS URL from the config file.
Also, a WebProxy with my credentials is created with username, pwd,
domain and proxyurl.

----CODE-----
....
if (settings.Credentials != null)
{

WebProxy proxy = new
WebProxy(settings.Credentials.Address, settings.Credentials.Port);
if (string.IsNullOrEmpty(settings.Credentials.Domain) )
{
proxy.Credentials = new
NetworkCredential(settings.Credentials.User,
settings.Credentials.Password); //, settings.Credentials.Domain);
} else {
proxy.Credentials = new
NetworkCredential(settings.Credentials.User,
settings.Credentials.Password, settings.Credentials.Domain);
}

wsContentClient.Proxy = proxy;

}
....

----END CODE----

When I try to invoke a method, I get the same 407 error:

-------Error-------
The request failed with HTTP status 407: Proxy Authentication Required.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at
Indra.Cms.Tools.EgnosAlerts.ContentHost.WsContentC lient.InsertRepositoryObject(String
repositoryName, String objXml) in
D:\Egnos\Indra.Cms\Tools\Indra.Cms.Tools.EgnosAler ts\Web
References\ContentHost\Reference.cs:line 143
at
Indra.Cms.Tools.EgnosAlerts.EgnosAlertsProcessor.P ublishAlert(MailMessage
msg) in
D:\Egnos\Indra.Cms\Tools\Indra.Cms.Tools.EgnosAler ts\EgnosAlertsProcessor.cs:line
149
at
Indra.Cms.Tools.EgnosAlerts.EgnosAlertsProcessor.P rocessMessages(Int32
max) in
D:\Egnos\Indra.Cms\Tools\Indra.Cms.Tools.EgnosAler ts\EgnosAlertsProcessor.cs:line
83
---------------------
Now. Does enyone know why this is happening?

TIA.

rcp.

Aug 18 '06 #1
2 11395
have you tried adding wsContentClient.PreAuthenticate = true; ?

Mike
http://www.seeknsnatch.com

"rcp" <ri******************@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi all,
I've read all posts from all existing threads and none of them worked
to solve my problem, although its exactly the same. I'll try to
explain my case and see if a kind soul could help me out:

I've a win32 service in C# on a client machine A, which accesses a WS
(C#) on a server machine B (hosted on an IIS)

Case 1:
If I try to add the WSDL for the WS through VS2005, the 'Discovery
Credentials for proxy server' pops up, and whatever user and pwd with
rights to get through is not working.

error:
-------------
There was an error downloading 'http://xxxx'.
Unable to connect to the remote server
-------------

Case 2:
I try to add the WSDL for the WS through WSDL.EXE, using proxy
user-password-domain on the command prompt, but I get the following
error.

wsdl /l:cs /n:ContentHost2/proxy:nnn.nnn.nnn.nnn:8080
/proxydomain:xxx.xx /proxypassword:aaaaaaa /proxyuse
rname:bbbbbb /o:d:\
http://aaa.bbb.ccc.ddd:8080/WebPorta...ices/WebServic
e1.asmx?wsdl

error:
-----------------
Error: There was an error processing
'http://aaa.bbb.ccc.ddd:8080/WebPortal/WebSer
vices/WebService1.asmx?wsdl'.
- There was an error downloading
'http://aaa.bbb.ccc.ddd:8080/WebPortal/WebServi
ces/WebService1.asmx?wsdl'.
- The request failed with HTTP status 407: Proxy Authentication
Required.

Case 3:
I use the WS created on my development machine (with its own IIS),
adding the WSDL as a web reference through VS2005.
It works.
On the win32 service config file, I configure it to use the service
hosted on Machine B (the one outside my domain, and needing a proxy to
get out.
I debug the service.
It instantiates the WS with no problem on a global variable, reading
the WS URL from the config file.
Also, a WebProxy with my credentials is created with username, pwd,
domain and proxyurl.

----CODE-----
...
if (settings.Credentials != null)
{

WebProxy proxy = new
WebProxy(settings.Credentials.Address, settings.Credentials.Port);
if (string.IsNullOrEmpty(settings.Credentials.Domain) )
{
proxy.Credentials = new
NetworkCredential(settings.Credentials.User,
settings.Credentials.Password); //, settings.Credentials.Domain);
} else {
proxy.Credentials = new
NetworkCredential(settings.Credentials.User,
settings.Credentials.Password, settings.Credentials.Domain);
}

wsContentClient.Proxy = proxy;

}
...

----END CODE----

When I try to invoke a method, I get the same 407 error:

-------Error-------
The request failed with HTTP status 407: Proxy Authentication Required.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at
Indra.Cms.Tools.EgnosAlerts.ContentHost.WsContentC lient.InsertRepositoryObject(String
repositoryName, String objXml) in
D:\Egnos\Indra.Cms\Tools\Indra.Cms.Tools.EgnosAler ts\Web
References\ContentHost\Reference.cs:line 143
at
Indra.Cms.Tools.EgnosAlerts.EgnosAlertsProcessor.P ublishAlert(MailMessage
msg) in
D:\Egnos\Indra.Cms\Tools\Indra.Cms.Tools.EgnosAler ts\EgnosAlertsProcessor.cs:line
149
at
Indra.Cms.Tools.EgnosAlerts.EgnosAlertsProcessor.P rocessMessages(Int32
max) in
D:\Egnos\Indra.Cms\Tools\Indra.Cms.Tools.EgnosAler ts\EgnosAlertsProcessor.cs:line
83
---------------------
Now. Does enyone know why this is happening?

TIA.

rcp.

Aug 18 '06 #2
rcp
I've tried...and still the same error.
Also I have the problem if I try to listen any machine outside my
domain. That is, I also have to listen on an IMAP server outside the
application domain, thus it has to go through the proxy. At least it's
what I assume since I get the same error when trying to connect to it
(I'm using StableBeast IMAP Library for this other one)

Any other ideas?
TIA.
R.

Michael ha escrito:
have you tried adding wsContentClient.PreAuthenticate = true; ?

Mike
http://www.seeknsnatch.com

"rcp" <ri******************@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi all,
I've read all posts from all existing threads and none of them worked
to solve my problem, although its exactly the same. I'll try to
explain my case and see if a kind soul could help me out:

I've a win32 service in C# on a client machine A, which accesses a WS
(C#) on a server machine B (hosted on an IIS)

Case 1:
If I try to add the WSDL for the WS through VS2005, the 'Discovery
Credentials for proxy server' pops up, and whatever user and pwd with
rights to get through is not working.

error:
-------------
There was an error downloading 'http://xxxx'.
Unable to connect to the remote server
-------------

Case 2:
I try to add the WSDL for the WS through WSDL.EXE, using proxy
user-password-domain on the command prompt, but I get the following
error.

wsdl /l:cs /n:ContentHost2/proxy:nnn.nnn.nnn.nnn:8080
/proxydomain:xxx.xx /proxypassword:aaaaaaa /proxyuse
rname:bbbbbb /o:d:\
http://aaa.bbb.ccc.ddd:8080/WebPorta...ices/WebServic
e1.asmx?wsdl

error:
-----------------
Error: There was an error processing
'http://aaa.bbb.ccc.ddd:8080/WebPortal/WebSer
vices/WebService1.asmx?wsdl'.
- There was an error downloading
'http://aaa.bbb.ccc.ddd:8080/WebPortal/WebServi
ces/WebService1.asmx?wsdl'.
- The request failed with HTTP status 407: Proxy Authentication
Required.

Case 3:
I use the WS created on my development machine (with its own IIS),
adding the WSDL as a web reference through VS2005.
It works.
On the win32 service config file, I configure it to use the service
hosted on Machine B (the one outside my domain, and needing a proxy to
get out.
I debug the service.
It instantiates the WS with no problem on a global variable, reading
the WS URL from the config file.
Also, a WebProxy with my credentials is created with username, pwd,
domain and proxyurl.

----CODE-----
...
if (settings.Credentials != null)
{

WebProxy proxy = new
WebProxy(settings.Credentials.Address, settings.Credentials.Port);
if (string.IsNullOrEmpty(settings.Credentials.Domain) )
{
proxy.Credentials = new
NetworkCredential(settings.Credentials.User,
settings.Credentials.Password); //, settings.Credentials.Domain);
} else {
proxy.Credentials = new
NetworkCredential(settings.Credentials.User,
settings.Credentials.Password, settings.Credentials.Domain);
}

wsContentClient.Proxy = proxy;

}
...

----END CODE----

When I try to invoke a method, I get the same 407 error:

-------Error-------
The request failed with HTTP status 407: Proxy Authentication Required.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at
Indra.Cms.Tools.EgnosAlerts.ContentHost.WsContentC lient.InsertRepositoryObject(String
repositoryName, String objXml) in
D:\Egnos\Indra.Cms\Tools\Indra.Cms.Tools.EgnosAler ts\Web
References\ContentHost\Reference.cs:line 143
at
Indra.Cms.Tools.EgnosAlerts.EgnosAlertsProcessor.P ublishAlert(MailMessage
msg) in
D:\Egnos\Indra.Cms\Tools\Indra.Cms.Tools.EgnosAler ts\EgnosAlertsProcessor.cs:line
149
at
Indra.Cms.Tools.EgnosAlerts.EgnosAlertsProcessor.P rocessMessages(Int32
max) in
D:\Egnos\Indra.Cms\Tools\Indra.Cms.Tools.EgnosAler ts\EgnosAlertsProcessor.cs:line
83
---------------------
Now. Does enyone know why this is happening?

TIA.

rcp.
Aug 21 '06 #3

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

Similar topics

1
6333
by: Mark Ferguson | last post by:
I've been trying to get a simple pycurl script working with an authenticating proxy, here is the code (with changes to protect the guilty!): from pycurl import * import StringIO b =...
3
7750
by: Wild Wind | last post by:
Hello all, I apologise in advance for the long windedness of this post, but I feel that if I am going to get any solution to this problem, it is important that I present as much information...
0
2088
by: J Ames | last post by:
Please, if this is the incorrect forum for this question, let me know which forum is most appropriate. I want to make sure I get visibility with the proper gurus! I have a .NET console app that...
4
5967
by: Boni | last post by:
I want consuming a webserivce trough a proxy. I use this code. myService s = new myService (); System.Net.WebProxy proxyObject = new System.Net.WebProxy("http://proxyhost:8080"); s.Proxy =...
7
40932
by: chandru1782 | last post by:
Dear friends, I am trying to use CPAN for installing some perl modules. i am using a ubuntu system, which has internet connection through lan and authenticated proxy. when trying to install...
3
25795
by: Learning.Net | last post by:
Hi All, I have an windows application created in C# &it is running fine on several of our customer. It does a httpWebrequest in the background. Everything was working fine but some customer are...
2
8104
by: =?Utf-8?B?TGVuc3Rlcg==?= | last post by:
A C# (.NET 2) application which uses the System.Net.HttpWebRequest object to request a resource over HTTPS is failing following the installation of a new proxy server on our internal network with...
5
5408
by: =?Utf-8?B?TWFyaw==?= | last post by:
I'm researching what is the best way to create a generic WCF proxy wrapper that has the following requirements: 1. Remove the System.ServiceModel config section requirement for clients. We have...
2
5393
by: krishnakrish | last post by:
Hi, My name is krishna. I am using asp.net 2.0 with C#. I amusing Windows XP professional as OS. When I post some data to an external web server I get the error as "The Remote server returned an...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6756
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.