467,879 Members | 1,236 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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
  • viewed: 10815
Share:
2 Replies
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Mark Ferguson | last post: by
4 posts views Thread by Boni | last post: by
2 posts views Thread by =?Utf-8?B?TGVuc3Rlcg==?= | 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.