The remote server returned an error: NotFound

The remote server returned an error: NotFound

Old forum URL: forums.lhotka.net/forums/t/6863.aspx


CampbellCM posted on Tuesday, April 28, 2009

I'm getting this error when I try and save a BO. The BO is an editable root. I've looked at several other postings for this error but I couldn't find anything relating to what I'm seeing.

Here is the stack trace:

System.ServiceModel.CommunicationException was unhandled by user code
Message="The remote server returned an error: NotFound"
StackTrace:
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult 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.EndUpdate(IAsyncResult result)
at Csla.WcfPortal.WcfPortalClient.Csla.WcfPortal.IWcfPortal.EndUpdate(IAsyncResult result)
at Csla.WcfPortal.WcfPortalClient.OnEndUpdate(IAsyncResult result)
at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
InnerException: System.Net.WebException
Message="The remote server returned an error: NotFound"
StackTrace:
at System.Net.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
at System.Net.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
InnerException: System.Net.WebException
Message="The remote server returned an error: NotFound"
StackTrace:
at System.Net.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.BrowserHttpWebRequest.<>c__DisplayClass5.b__4(Object sendState)
at System.Net.AsyncHelper.<>c__DisplayClass2.b__0(Object sendState)
InnerException:

Here is how I'm saving the BO:

public void Save()
{
if (_user != null)
_user.BeginSave(SaveComplete);
}

private void SaveComplete(object sender, Csla.Core.SavedEventArgs e)
{
if (e.Error != null)
MessageBox.Show(e.Error.Message);
}

I have breakpoints set on the DataPortal_Insert and DataPortal_Update overrides and they are not being hit.

Any ideas on what the problem is or how to troubleshoot it?

RockfordLhotka replied on Tuesday, April 28, 2009

Do other data portal operations work?

Are you using ObjectFactory?

I usually hit this when the .NET type loader can't find the assembly or class - due to a typo in a config file or an ObjectFactory attribute parameter.

PeteH replied on Tuesday, April 28, 2009

I do get this message myself intermittently. To fix it, I usually have to clean the solution, delete the temporary ASP.NET files, exit Visual Studio, and rebuild everything (including the Csla dlls). Thankfully it doesn't happen too often, and it might be related to our network rather than anything in the framework, but it's hard to tell..

CampbellCM replied on Tuesday, April 28, 2009

DataPortal_Fetch works fine. The Insert, Update, and Delete operations are all executed via the Save...right? I'm not using ObjectFactory, just straight up CSLA with LINQ To SQL for the CRUD. When I look at the http for the fetch I can see a cost of about 140K. I would imagine that the cost of a save would be about the same. The http error I see is 400 and there are zero bytes to go with it.

CampbellCM replied on Tuesday, April 28, 2009

Where are the temporary ASP.NET files?

CampbellCM replied on Tuesday, April 28, 2009

Okay, I found the temporary ASP.NET files. I did what PeteH suggested but I still have the same problem.

RockfordLhotka replied on Tuesday, April 28, 2009

Are you using compression? If not, you should.

 

Have you upped the max size limits on the WCF config? That is required for pretty much any app.

 

Rocky

 

CampbellCM replied on Wednesday, April 29, 2009

My ServiceReferences.ClientConfig has this:

name="BasicHttpBinding_IWcfPortal" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00"

The system.serviceModel section of my Web.Config has this:

binding name="BasicHttpBinding_IWcfPortal" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00"

And this:

readerQuotas maxBytesPerRead="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647"

I'm still having the same problem. I will go ahead and add compression after I get through this issue, but I don't want to further muddy the waters at this point. Since I'm trying to save just one BO even the numbers currently in the configuration files would be gross overkill.

CampbellCM replied on Wednesday, April 29, 2009

Okay, I feel like an ass. I added compression and it works. Rule 1: Never doubt Rocky. Rule 2: If you ever get the urge to doubt Rocky please refer to rule number 1. Thanks Rocky!

RockfordLhotka replied on Wednesday, April 29, 2009

I’m just glad it works :)

 

Odds are though, that you were hitting some size limit – and you could hit it even with compression, and in that case you’ll have to figure out which value needs to be upped in the client and/or server config files.

 

Rocky

 

 

From: CampbellCM [mailto:cslanet@lhotka.net]
Sent: Wednesday, April 29, 2009 9:33 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] RE: The remote server returned an error: NotFound

 

Okay, I feel like an ass. I added compression and it works. Rule 1: Never doubt Rocky. Rule 2: If you ever get the urge to doubt Rocky please refer to rule number 1. Thanks Rocky!

decius replied on Thursday, June 11, 2009

I'm hitting this problem too, I added compression, and maxed out the bindings on the client and the server. 

Is there an easy way to test for hitting a max size limit, so that I could verify that that is indeed my problem?  I don't know what else to do at this point.  thanks for any help.

zhengokusa replied on Thursday, June 11, 2009

Please forget me, how to use compression ? 

 

decius replied on Thursday, June 11, 2009

I found my problem, it was just a webconfig that was misconfigured.  0_o  In my case, the WcfService was literally "Not Found" lol.

zhengokusa, there's a sample project that does this in the Samples that Rocky gives you alongside the Silverlight for CSLA download called "RemotePortalWithCompressedProxy".  It's pretty simple, you basically just need to copy the Compression classes from this project and bring the ICSharpCode reference along with it.  Plus, don't forget to change your webconfig's to point to the new .svc that you'll also have to make.  It's all in that solution.

zhengokusa replied on Thursday, June 11, 2009

Thanks dude

RockfordLhotka replied on Thursday, June 11, 2009

This is in the FAQ

 

www.lhotka.net/cslanet/faq

 

under the Silverlight FAQ.

 

 

From: zhengokusa [mailto:cslanet@lhotka.net]
Sent: Thursday, June 11, 2009 1:16 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] RE: The remote server returned an error: NotFound

 

Please forget me, how to use compression ? 

 



JonM replied on Wednesday, March 07, 2012

I'm also running into this issue with a big object.  Not sure how to do compression on the SL portal.  I checked the FAQ link for silverlight but I don't don't see anything in there about compression.  Any ideas where to start?

RockfordLhotka replied on Wednesday, March 07, 2012

The data portal configuration information is on the data portal page in the FAQ:

http://www.lhotka.net/cslanet/faq/DataPortalFaq.ashx

I also walk through implementing compression in the Silverlight video series and in the Using CSLA 4: Data Portal Configuration book.

Copyright (c) Marimer LLC