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
608 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now