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.