New Posts New Posts RSS Feed: Error when attempting query to service from Silverlight
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Error when attempting query to service from Silverlight

 Post Reply Post Reply
Author
leeatkinson View Drop Down
Newbie
Newbie


Joined: 01-Jul-2010
Posts: 17
Post Options Post Options   Quote leeatkinson Quote  Post ReplyReply Direct Link To This Post Topic: Error when attempting query to service from Silverlight
    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}
Back to Top
leeatkinson View Drop Down
Newbie
Newbie


Joined: 01-Jul-2010
Posts: 17
Post Options Post Options   Quote leeatkinson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 424
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 07-Jul-2010 at 12:25pm
Cool.  Thanks for letting everyone know.
Back to Top
cdelbecq View Drop Down
Newbie
Newbie
Avatar

Joined: 03-Dec-2010
Location: Mr
Posts: 1
Post Options Post Options   Quote cdelbecq Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
leeatkinson View Drop Down
Newbie
Newbie


Joined: 01-Jul-2010
Posts: 17
Post Options Post Options   Quote leeatkinson Quote  Post ReplyReply Direct Link To This Post Posted: 03-Dec-2010 at 2:22am
You need to specify ContractNamespace on both assemblies to be the same.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down