Print Page | Close Window

Error when attempting query to service from Silverlight

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=1944
Printed Date: 29-Jul-2026 at 11:17am


Topic: Error when attempting query to service from Silverlight
Posted By: leeatkinson
Subject: Error when attempting query to service from Silverlight
Date Posted: 06-Jul-2010 at 1:04pm
Hi

I have four projects - a .NET one for the model, and Silvelright one for the model (linking to the .IB.Designer.cs file), one for the Silvelright app and one for the web application.

It compiles OK, but when the client attempts a very simple query (return all entities - there's about 100 currently), I get the error below. It is similar to an error in http://www.ideablade.com/forum/forum_posts.asp?TID=1932 but I have checked my references against http://ideablade.com/Friends/FourProject.zip and it all looks in order.

IdeaBlade.EntityModel.EntityServerException: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ideablade.com/EntityModel:entityQuerySurrogate. The InnerException message was 'Element 'http://ideablade.com/Linq:Value' contains data from a type that maps to the name 'http://ideablade.com/EntityModel:EntityQueryProxyOfEntityxAEFGe0B'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'EntityQueryProxyOfEntityxAEFGe0B' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details. ---> System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ideablade.com/EntityModel:entityQuerySurrogate. The InnerException message was 'Element 'http://ideablade.com/Linq:Value' contains data from a type that maps to the name 'http://ideablade.com/EntityModel:EntityQueryProxyOfEntityxAEFGe0B'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'EntityQueryProxyOfEntityxAEFGe0B' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.
   at IdeaBlade.EntityModel.RemoteEntityServerProxyBase.CheckConnection(Exception pException)
   at IdeaBlade.EntityModel.EntityServerProxy.Fetch(SessionBundle bundle, IEntityQuerySurrogate query)
   at IdeaBlade.EntityModel.EntityManager.AsyncFetchWorker(AsyncEventArgs state)
   --- End of inner exception stack trace ---
   at IdeaBlade.EntityModel.EntityManager.HandleEntityServerException(Exception pException, Boolean pTryToHandle, PersistenceOperation pOperation)
   at IdeaBlade.EntityModel.EntityManager.<ExecuteQueryAsyncCore>b__4e[T](EntityQueryOperation`1 op)
   at IdeaBlade.EntityModel.AsyncProcessor`1.<Execute>b__5(Object x)}     System.Exception {IdeaBlade.EntityModel.EntityServerException}



Replies:
Posted By: leeatkinson
Date Posted: 07-Jul-2010 at 7:52am
I've resolved it - the problem I was specifying ContractNamespace on the .NET's assembly but not Silverlight's.

Lee


Posted By: ting
Date Posted: 07-Jul-2010 at 12:25pm
Cool.  Thanks for letting everyone know.


Posted By: cdelbecq
Date Posted: 03-Dec-2010 at 12:07am
Hello,
 
I'm facing exactly the same problem,  and newbi on devforce
 
Could you explain what you've done to resolve IT
 
Thanks in advance
Best regards
   Christophe
 


Posted By: leeatkinson
Date Posted: 03-Dec-2010 at 2:22am
You need to specify ContractNamespace on both assemblies to be the same.



Print Page | Close Window