No connection could be made because the target machine actively refused it

H

hufaunder

I have a website that consumes a webservice. Both of them are in the
Default Website folder. I can execute the service without any problem
when I go to the test page http://localhost/Service.asmx. When I try to
consume that webservice from the website I get the error shown bellow.
In my web.config I have:

<authentication mode="Windows"/>
<identity impersonate="true" userName="auser" password="apwd"/>

IIS is configured as "Integrated Windows authentication" and "Enable
anonymous access" is disabled.

System.Security.Principal.WindowsIdentity.GetCurrent().Name returns
"auser".

I am struggling with that for a LONG time so any help is greatly
appreciated.

Thanks

Error:

"No connection could be made because the target machine actively
refused it
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection
could be made because the target machine actively refused it

Line 110: object[] results = this.Invoke("MyWebservice", new
object[] {

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files\root\26676eb7\92c7e946\App_WebReferences.rglqbs34.0.cs
Line: 110 "
 
K

Kristofer Gafvert

Since it works locally, we can almost rule out a problem with IIS. But can
you please verify that IIS binds to the IP address that you are trying to
connect to from a remote machine?

Is it possible that you have a firewall enabled (Windows XP's or a
third-party firewall) that could be blocking remote requests on port 80
(assuming that is the port you use)?
 
B

bruce barker \(sqlwork.com\)

local accounts generally do not have network access. you should use a domain
account.


-- bruce (sqlwork.com)
 
H

hufaunder

Thanks for the reply. Actually, I cannot connect even on my local
machine. If I go to the test site of the webservice it works
(http://localhost/Service.asmx) but http://localhost/MyWebservice.aspx
which uses the webservice does not.

Thanks

Kristofer said:
Since it works locally, we can almost rule out a problem with IIS. But can
you please verify that IIS binds to the IP address that you are trying to
connect to from a remote machine?

Is it possible that you have a firewall enabled (Windows XP's or a
third-party firewall) that could be blocking remote requests on port 80
(assuming that is the port you use)?


--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


I have a website that consumes a webservice. Both of them are in the
Default Website folder. I can execute the service without any problem
when I go to the test page http://localhost/Service.asmx. When I try to
consume that webservice from the website I get the error shown bellow.
In my web.config I have:

<authentication mode="Windows"/>
<identity impersonate="true" userName="auser" password="apwd"/>

IIS is configured as "Integrated Windows authentication" and "Enable
anonymous access" is disabled.

System.Security.Principal.WindowsIdentity.GetCurrent().Name returns
"auser".

I am struggling with that for a LONG time so any help is greatly
appreciated.

Thanks

Error:

"No connection could be made because the target machine actively
refused it
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection
could be made because the target machine actively refused it

Line 110: object[] results = this.Invoke("MyWebservice", new
object[] {

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files\root\26676eb7\92c7e946\App_WebReferences.rglqbs34.0.cs
Line: 110 "
 
S

Swanagon, John M \(John\)

What is your IIS configuration look like? Is Anonymous access disabled? IE
is probably doing the NTLM authentication automatically. The website won't
do that. Try disabling integrated authentication on IIS itself and enable
only Anonymous access. I'd bet that fixes the problem. Hope this helps.

Sincerely,
John Swanagon
Sr. Software Engineer, Avaya Labs
Avaya Inc.
(e-mail address removed)
 
H

hufaunder

My IIS configuration is "Integrated Windows authentication" and "Enable

anonymous access" is disabled. The reason I am using impersonation is
because I need the additional access rights.

Swanagon said:
What is your IIS configuration look like? Is Anonymous access disabled? IE
is probably doing the NTLM authentication automatically. The website won't
do that. Try disabling integrated authentication on IIS itself and enable
only Anonymous access. I'd bet that fixes the problem. Hope this helps.

Sincerely,
John Swanagon
Sr. Software Engineer, Avaya Labs
Avaya Inc.
(e-mail address removed)

I have a website that consumes a webservice. Both of them are in the
Default Website folder. I can execute the service without any problem
when I go to the test page http://localhost/Service.asmx. When I try to
consume that webservice from the website I get the error shown bellow.
In my web.config I have:

<authentication mode="Windows"/>
<identity impersonate="true" userName="auser" password="apwd"/>

IIS is configured as "Integrated Windows authentication" and "Enable
anonymous access" is disabled.

System.Security.Principal.WindowsIdentity.GetCurrent().Name returns
"auser".

I am struggling with that for a LONG time so any help is greatly
appreciated.

Thanks

Error:

"No connection could be made because the target machine actively
refused it
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection
could be made because the target machine actively refused it

Line 110: object[] results = this.Invoke("MyWebservice", new
object[] {

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files\root\26676eb7\92c7e946\App_WebReferences.rglqbs34.0.cs
Line: 110 "
 
S

Swanagon, John M \(John\)

Ah, got it. Then, in that case, all you need to do is authenticate to the
webserver before your site will be able to access the web service. I
believe it would involve providing the correct headers telling the server to
use NTLM authentication. Since your website is using impersonation, the
context for NTLM should exist in order for it to work properly. I don't
know the code right off-hand, but if you want, I could write something up
and post it here. Just let me know...

Thanks,
John

My IIS configuration is "Integrated Windows authentication" and "Enable

anonymous access" is disabled. The reason I am using impersonation is
because I need the additional access rights.

Swanagon said:
What is your IIS configuration look like? Is Anonymous access disabled?
IE
is probably doing the NTLM authentication automatically. The website
won't
do that. Try disabling integrated authentication on IIS itself and
enable
only Anonymous access. I'd bet that fixes the problem. Hope this helps.

Sincerely,
John Swanagon
Sr. Software Engineer, Avaya Labs
Avaya Inc.
(e-mail address removed)

I have a website that consumes a webservice. Both of them are in the
Default Website folder. I can execute the service without any problem
when I go to the test page http://localhost/Service.asmx. When I try to
consume that webservice from the website I get the error shown bellow.
In my web.config I have:

<authentication mode="Windows"/>
<identity impersonate="true" userName="auser" password="apwd"/>

IIS is configured as "Integrated Windows authentication" and "Enable
anonymous access" is disabled.

System.Security.Principal.WindowsIdentity.GetCurrent().Name returns
"auser".

I am struggling with that for a LONG time so any help is greatly
appreciated.

Thanks

Error:

"No connection could be made because the target machine actively
refused it
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection
could be made because the target machine actively refused it

Line 110: object[] results = this.Invoke("MyWebservice", new
object[] {

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files\root\26676eb7\92c7e946\App_WebReferences.rglqbs34.0.cs
Line: 110 "
 
H

hufaunder

If you could show me some code that leads me in the right direction
that would be very much appreciated. I'm a novice with this stuff and
really didn't get a good grip on authentication yet.

Thanks

Swanagon said:
Ah, got it. Then, in that case, all you need to do is authenticate to the
webserver before your site will be able to access the web service. I
believe it would involve providing the correct headers telling the server to
use NTLM authentication. Since your website is using impersonation, the
context for NTLM should exist in order for it to work properly. I don't
know the code right off-hand, but if you want, I could write something up
and post it here. Just let me know...

Thanks,
John

My IIS configuration is "Integrated Windows authentication" and "Enable

anonymous access" is disabled. The reason I am using impersonation is
because I need the additional access rights.

Swanagon said:
What is your IIS configuration look like? Is Anonymous access disabled?
IE
is probably doing the NTLM authentication automatically. The website
won't
do that. Try disabling integrated authentication on IIS itself and
enable
only Anonymous access. I'd bet that fixes the problem. Hope this helps.

Sincerely,
John Swanagon
Sr. Software Engineer, Avaya Labs
Avaya Inc.
(e-mail address removed)

I have a website that consumes a webservice. Both of them are in the
Default Website folder. I can execute the service without any problem
when I go to the test page http://localhost/Service.asmx. When I try to
consume that webservice from the website I get the error shown bellow.
In my web.config I have:

<authentication mode="Windows"/>
<identity impersonate="true" userName="auser" password="apwd"/>

IIS is configured as "Integrated Windows authentication" and "Enable
anonymous access" is disabled.

System.Security.Principal.WindowsIdentity.GetCurrent().Name returns
"auser".

I am struggling with that for a LONG time so any help is greatly
appreciated.

Thanks

Error:

"No connection could be made because the target machine actively
refused it
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection
could be made because the target machine actively refused it

Line 110: object[] results = this.Invoke("MyWebservice", new
object[] {

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files\root\26676eb7\92c7e946\App_WebReferences.rglqbs34.0.cs
Line: 110 "
 
S

Swanagon, John M \(John\)

Sure, will do. I will post here in a little bit.

John

If you could show me some code that leads me in the right direction
that would be very much appreciated. I'm a novice with this stuff and
really didn't get a good grip on authentication yet.

Thanks

Swanagon said:
Ah, got it. Then, in that case, all you need to do is authenticate to
the
webserver before your site will be able to access the web service. I
believe it would involve providing the correct headers telling the server
to
use NTLM authentication. Since your website is using impersonation, the
context for NTLM should exist in order for it to work properly. I don't
know the code right off-hand, but if you want, I could write something up
and post it here. Just let me know...

Thanks,
John

My IIS configuration is "Integrated Windows authentication" and "Enable

anonymous access" is disabled. The reason I am using impersonation is
because I need the additional access rights.

Swanagon, John M (John) wrote:
What is your IIS configuration look like? Is Anonymous access
disabled?
IE
is probably doing the NTLM authentication automatically. The website
won't
do that. Try disabling integrated authentication on IIS itself and
enable
only Anonymous access. I'd bet that fixes the problem. Hope this
helps.

Sincerely,
John Swanagon
Sr. Software Engineer, Avaya Labs
Avaya Inc.
(e-mail address removed)

I have a website that consumes a webservice. Both of them are in the
Default Website folder. I can execute the service without any
problem
when I go to the test page http://localhost/Service.asmx. When I try
to
consume that webservice from the website I get the error shown
bellow.
In my web.config I have:

<authentication mode="Windows"/>
<identity impersonate="true" userName="auser" password="apwd"/>

IIS is configured as "Integrated Windows authentication" and "Enable
anonymous access" is disabled.

System.Security.Principal.WindowsIdentity.GetCurrent().Name returns
"auser".

I am struggling with that for a LONG time so any help is greatly
appreciated.

Thanks

Error:

"No connection could be made because the target machine actively
refused it
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection
could be made because the target machine actively refused it

Line 110: object[] results = this.Invoke("MyWebservice",
new
object[] {

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files\root\26676eb7\92c7e946\App_WebReferences.rglqbs34.0.cs
Line: 110 "
 

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