New Posts New Posts RSS Feed: Sometimes exception is thrown when retrieving large amounts of data from server
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Sometimes exception is thrown when retrieving large amounts of data from server

 Post Reply Post Reply
Author
rasmus View Drop Down
Groupie
Groupie


Joined: 05-Aug-2009
Location: Denmark
Posts: 63
Post Options Post Options   Quote rasmus Quote  Post ReplyReply Direct Link To This Post Topic: Sometimes exception is thrown when retrieving large amounts of data from server
    Posted: 27-Aug-2009 at 5:16am
Hi
 
If I retrieve large amounts of data from the server to my SL client, I sometimes get the exception shown in the bottom of this post. Sometimes I am able to retrieve all 90.000 items, but mostly I get the exception when retrieving more than 35.000 items - this is the only pattern to the error. When keeping below 35.000 there is no problems. I am running locally when I get the error.
 
My ServiceReferences.clientconfig looks like this:
 

<customBinding>

<!-- Custom binding using http, binary encoding, no security -->

<binding name="customBinaryBinding" receiveTimeout="00:10:00" sendTimeout="00:10:00" closeTimeout="00:10:00" openTimeout="00:10:00">

<binaryMessageEncoding />

<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />

</binding>

</customBinding>

and my binding in my Web.config looks like this
 

<binding name="customBinaryBinding" receiveTimeout="00:10:00" sendTimeout="00:10:00" closeTimeout="00:10:00" openTimeout="00:10:00">

<binaryMessageEncoding>

<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" />

</binaryMessageEncoding>

<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />

</binding>

 Do you have any ideas?
 
 
The Exception:
 
 

Message: Unhandled Error in Silverlight Application

Code: 4004   

Category: ManagedRuntimeError      

Message: System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid.  Check InnerException for exception details. ---> 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:FetchResult. The InnerException message was 'Element 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType' contains data of the 'http://www.w3.org/2001/XMLSchemH:string' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'string' 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.Dispatcher.NetDispatcherFaultException: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ideablade.com/EntityModel:FetchResult. The InnerException message was 'Element 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType' contains data of the 'http://www.w3.org/2001/XMLSchemH:string' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'string' 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.Runtime.Serialization.SerializationException: Element 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType' contains data of the 'http://www.w3.org/2001/XMLSchemH:string' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'string' 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.

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)

   at ReadArrayOfanyTypeFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract )

   at System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)

   at ReadDeconstructedEntityFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] )

   at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)

   at ReadArrayOfDeconstructedEntityFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract )

   at System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)

   at ReadEntitiesDataBlockFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] )

   at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)

   at ReadDataQueryResultFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] )

   at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)

   at ReadArrayOfDataQueryResultFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString , XmlDictionaryString , CollectionDataContract )

   at System.Runtime.Serialization.CollectionDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)

   at ReadDataQueryResultCollectionFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] )

   at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)

   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)

   at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)

   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)

   at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)

   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)

   --- End of inner exception stack trace ---

   at IdeaBlade.EntityModel.RemoteEntityServerProxy.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 ---

   --- End of inner exception stack trace ---

   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()

   at IdeaBlade.EntityModel.EntityFetchedEventArgs`1.get_Result()

   at NextStay.DevForce.DataGridViewModel`1.<Search>b__1(EntityFetchedEventArgs`1 args)

   at IdeaBlade.EntityModel.AsyncProcessor`1.Signal()

   at IdeaBlade.EntityModel.AsyncProcessor`1.<Execute>b__1(Object x)    

 

Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 28-Aug-2009 at 10:36am
It's interesting that the problem is periodic. 
 
In our tests we can successfully return over 100,000 items to a Silverlight client, as long as the bindings are modified to include timeouts.  I have to admit that the payload size in our tests is still relatively small even with 100k+ items, so our tests might not really compare to yours.
 
My best guess is that the ServiceReferences.ClientConfig might not actually be used here.  It won't be used if there are any errors in it, which would cause DevForce to default to its standard bindings.  It's unfortunately difficult to tell in release 5.2.1 and earlier versions where configuration information is loaded from because no trace log is written, but if you're running in Visual Studio you might be able to spot the tracing information as it's written to the output window.
 
You might want to use Fiddler to trace the request and response here too.  You'd see payload sizes for one, and something might show up about the error.
 
If the ClientConfig is in fact being used and it looks like the payload size is quite large, you can also try turning on IIS compression to compress the size of the response message (containing the query results) sent to the client. 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down