CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

E-books Sample: Help me get it working!!

rated by 0 users
Not Answered This post has 0 verified answers | 6 Replies | 3 Followers

Top 75 Contributor
107 Posts
jh72i posted on Fri, Oct 7 2011 11:14 AM

Every day a new problem making every day damn frustrating at the moment and the chance of making deadlines more and more unlikely.

Today i have hit the "Remote Server returned and error NotFound" exception when trying to get credential sharing between a SL client and a backend. I have downloaded and run Rocky's sample: 04-DataPortal-110504\Authentication\Windows\Windows.sln and simply cannot figure out how to get it to run properly.

I can get it to run if i remove the following section from the config file:
<security mode="TransportCredentialOnly">
<
transport clientCredentialType="Windows" /></security>

I'm dealing with a lot of new technologies and approaches at the moment so please appreciate i am no expert in any of this. I need to get a bunch of things working first and come back and figure them all out later!

What do i have to do to get this sample to just work.

Thank you

All Replies

Top 75 Contributor
107 Posts
jh72i replied on Fri, Oct 7 2011 4:06 PM
The error: {: The remote server returned an error: NotFound. at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.WcfPortalClientChannel.EndFetch(IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.Csla.WcfPortal.IWcfPortal.EndFetch(IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.OnEndFetch(IAsyncResult result) at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result) : The remote server returned an error: NotFound. at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result) : The remote server returned an error: NotFound. at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.b__4(Object sendState) at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.b__0(Object sendState) } [Csla.DataPortalException]: {: The remote server returned an error: NotFound. at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.WcfPortalClientChannel.EndFetch(IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.Csla.WcfPortal.IWcfPortal.EndFetch(IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.OnEndFetch(IAsyncResult result) at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result) : The remote server returned an error: NotFound. at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result) : The remote server returned an error: NotFound. at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.b__4(Object sendState) at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.b__0(Object sendState) } Data: {System.Collections.ListDictionaryInternal} InnerException: null Message: "The remote server returned an error: NotFound." StackTrace: null
Top 10 Contributor
9,269 Posts

The "NotFound" exception is (sadly) useless. It just means that WCF couldn't wire up the client's call to a service. It usually does mean your call isn't getting to any of your server-side code, and often indicates a server-side configuration or assembly reference issue. Sometimes you can use fiddler or WCF tracing to get more information.

To put it bluntly: WCF security is a b*tch.

The number of moving parts and configuration options/issues are vast.

You can start by putting an aspx page into your web site, and on that page display the information from the current principal. That can often help diagnose errors with the server-side security configuration. Basically, before you can do anything on the client, you have to get IIS and ASP.NET configured to require Windows authentication and to do impersonation. This is easier to debug in aspx than in an svc.

Rocky

Top 50 Contributor
178 Posts
Tim replied on Mon, Oct 10 2011 9:39 PM

I've recently had to get an SL4 app working with Windows/AD security and it did take a lot of work to figure out the right combination of settings on IIS and within the config file.  In my case, I found it helpful first of all to browse to the service address and see if my browser could reach it.  If I wasn't able to do that, I wouldn't bother with the app.  That may or may not be the right way to do it, but that is how I approached it.

Tim

Top 75 Contributor
107 Posts
jh72i replied on Wed, Oct 12 2011 5:34 AM
Thanks for the replies folks. Been in hospital since the weekend with my brand new baby boy so not advanced any on this problem & funnily enough it has somehow lost it's importance in my priority list :-) it will of course move back up when the need to get paid kicks in. Rocky can you get working on Csla90 for my boy should he be crazy enough to choose software as a career. If such a thing exists in 2030 :-)
Top 10 Contributor
9,269 Posts

jh72i:
Rocky can you get working on Csla90 for my boy should he be crazy enough to choose software as a career. If such a thing exists in 2030 :-)

I'll get right on that :)

Congratulations on the new baby, that's great news!

Rocky

Top 75 Contributor
107 Posts
jh72i replied on Mon, Oct 17 2011 3:57 AM

Thanks for the congrats Rocky - I'm pretty sure I have read that you are a dad too so you'll understand my emotional state at present.

And thanks to both fo you for the steers about the notfound exception. I probably wasn't thinking straight before but my head is clear now and within 5 minutes of sitting at my desk i managed to sort out the problem. Well, for now at least.
I looked at the IISExpress applicationhost.config file and enabled the WindowsAuthentication flag. That gets rid of the NotFound exception and I can see my security info travel to my dataportal_xyz methods. I have a suspicion that this probably isn't the ultimate solution but it allows me to get through this roadblock for now so, again, thank you both.

 <security>
 <authentication>
  <windowsAuthentication enabled="true">
   <providers>
    <add value="Negotiate" />
    <add value="NTLM" />
   </providers>
  </windowsAuthentication>
 </authentication>

 

Page 1 of 1 (7 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems