Print Page | Close Window

EntityServerException: The remote server returned an error: NotFound

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2431
Printed Date: 29-Jul-2026 at 12:18pm


Topic: EntityServerException: The remote server returned an error: NotFound
Posted By: CalvinC
Subject: EntityServerException: The remote server returned an error: NotFound
Date Posted: 10-Jan-2011 at 10:24am

Hi, I’m brand new to DevForce and am merely checking it out at this point.

Here’s the problem I’m experiencing:

When I try to fetch data via:

IEntityQuery<CriterionItem<intstring>> entityQuery = GetCriteriaQuery();
entityQuery.ExecuteAsync((op) => { op.Results.OfType<CriterionItem<intstring>>().ToArray(); }); 

I get this error:

IdeaBlade.EntityModel.EntityServerException was unhandled
  Message=The remote server returned an error: NotFound.
  Cancelled=false
  StackTrace:
       at IdeaBlade.EntityModel.EntityQueriedEventArgs`1.get_Results()
       at IdeaBlade.EntityModel.EntityQueryOperation`1.get_Results()
  InnerException: System.ServiceModel.CommunicationException
       Message=The remote server returned an error: NotFound.
       StackTrace:
            at IdeaBlade.EntityModel.EntityServerProxy.Fetch(SessionBundle bundle, IEntityQuerySurrogate query)
            at IdeaBlade.EntityModel.EntityManager.AsyncFetchWorker(AsyncEventArgs state)
       InnerException: System.Net.WebException
            Message=The remote server returned an error: NotFound.
            StackTrace:
                 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)
            InnerException: System.Net.WebException
                 Message=The remote server returned an error: NotFound.
                 StackTrace:
                      at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
                      at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
                      at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
                 InnerException:

 

The CriterionItem class is defined as follows and is shared with the server.

 

    public interface ICriterionItem
    {
        object Key { getset; }
        object Value { getset; }
    }
 
    public interface ICriterionItem<TKey, TValue> : ICriterionItem
    {
        new TKey Key { getset; }
        new TValue Value { getset; }
    }
 
    public partial class CriterionItem<TKey, TValue> : ICriterionItem<TKey, TValue>
    {
        public TKey Key { getset; }
        public TValue Value { getset; }
        object ICriterionItem.Key { get { return (object)Key; } set { value = (object)Key; } }
        object ICriterionItem.Value { get { return (object)Value; } set { value = (object)Value; } }
    }

 

 

DebugLog.xml doesn’t indicate any problems.  I see a couple of 504 response codes with Fiddler:

System.Xml.XmlException: The input source is not correctly formatted.
   at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
   at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1)
   at System.Xml.XmlBufferReader.ReadDictionaryKey()
   at System.Xml.XmlBinaryReader.ReadDictionaryName(StringHandle s)
   at System.Xml.XmlBinaryReader.ReadNode()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at BinaryMessageFiddlerExtension.BinaryInspector.LoadMessageIntoDocument(Byte[] encodedMessage)
   at BinaryMessageFiddlerExtension.BinaryInspector.UpdateView(Byte[] bytes)

 

Any ideas what’s going on here?  Thanks!




Replies:
Posted By: DenisK
Date Posted: 10-Jan-2011 at 6:37pm
Hi CalvinC;

Could you post the GetCriteriaQuery method?

I'm assuming that the method returns an EntityQuery of type CriterionItem. How is this entity defined in the model?


Posted By: CalvinC
Date Posted: 11-Jan-2011 at 8:15am
Here's the signature:

IEntityQuery<CriterionItem> GetCriteriaQuery()

The CriterionItem isn't an IbEm.Entity.  It's simply a class defined on the Client and shared with the Server.  

Is it necessary to define this as an Entity?  I tried adding a Key attribute to no avail.

thanks for the help


Posted By: DenisK
Date Posted: 12-Jan-2011 at 6:11pm
Hi CalvinC;

If CriterionItem is not derived from IdeaBlade.EntityModel.Entity then it must be implemented as a POCO.

Please see our Wiki for more details.

http://drc.ideablade.com/xwiki/bin/view/Documentation/POCOSupportInDevForce - http://drc.ideablade.com/xwiki/bin/view/Documentation/POCOSupportInDevForce



Print Page | Close Window