Solved

URGENT: Can't use web service from ASP.net web application after switching to SSL and Integrated Windows Authentication

Posted on 2006-11-07
5
613 Views
Last Modified: 2012-06-27
I am have an ASP.net 2.0 web application that calls an ASP.net 2.0 web service on the same server in a different directory.  At first the service was open with no encryption and anonymous access was allowed.  The web service worked fine like this.

We recently installed an SSL certifice for the server and I un-checked anonymous access on the directory the web service is in and just left Integrated Windows Authentication.

The web application now reports the following error when calling the web service:

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

[SocketException (0x274d): No connection could be made because the target machine actively refused it]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1002146
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431

[WebException: Unable to connect to the remote server]
   System.Net.HttpWebRequest.GetRequestStream() +1504525
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +103
   WS_Security.Security.Login(String Acf2Id, String Acf2Password) +63
   ASP.login_aspx.blnCheckUserLogin(String sUser, String sPass) in c:\inetpub\wwwroot\GSS\Login.aspx:52
   ASP.login_aspx.Login1_Authenticate(Object sender, AuthenticateEventArgs e) in c:\inetpub\wwwroot\GSS\Login.aspx:65
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +106
   System.Web.UI.WebControls.Login.AttemptLogin() +105
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
------------------------------------------------------------------------------------------------------------------------------------------------------------------

We have a windows application that also calls the web service.  The following sample code allowed it to work correctly:

Dim ws As New WebServiceName
ws.Credentials = new NetworkCredential("user", "pass", "domain")
ws.DoSomething()

When I used the same code in the web application, nothing changed and I got the same error.

Any help would be greatly appreciated.
0
Comment
Question by:lbyrdjr
  • 2
5 Comments
 

Author Comment

by:lbyrdjr
ID: 17893509
Another thing that I didn't mention was that the windows application that uses the service does not run on the server.  And when I debug the web application on my development machine the web service works fine.  It is only when calling the web service from the web application on the server that fails.
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17893745
The only thing that I can think of is that the windows program that works operates under the credentials of the logged on user but the asp.net app runs under MACHINE\ASPNET. I know you are setting the credentials for the webservice call but maybe this is not working correctly.

Can you modify your webservice to monitor the requests comming in and check the credentials to see what's getting passed in.

If all else fails you couyld use inpersonation in the web.config file.

Good luck
0
 

Author Comment

by:lbyrdjr
ID: 17901257
I found the solution.  It was not really a problem with ASP.net.  As explained to me, the browser settings were set for the primary DNS to point to localhost.  The domain name (DomainName.com and www.DomainName.com) had to be added to the HOSTS file.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18106259
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question