0
votes

I've Wcf method that returns a dataset that contains about 100000 records. The size of body message is about 30 Mb uncompressed. Sometime it works fine, but many times I receive following xml exception during deserialization operation:

Error during deserialization of object System.Data.DataSet. Unexpected end of file has occurred. The following elements are not closed: NumEffetto, Scadenze, NewDataSet, diffgram, GetChangesResult, GetChangesResponse, Body, Envelope.'

Stack trace:

in System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest) in System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameter(XmlDictionaryReader reader, PartInfo part, Boolean isRequest) in System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest) in System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest) in System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters) in System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc) in System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) in System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) in System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) in System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) in System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) in Kronos.WCFSync.ISyncService.GetChanges(Int64 clientCTVersion, Int64 verPubblicazione, SyncParam[] parameters) in Kronos.WCFSync.SyncServiceClient.GetChanges(Int64 clientCTVersion, Int64 verPub, SyncParam[] parameters) in Kronos.SyncManager.Sync()

2

2 Answers

0
votes

Fixed! The problem was sendTimeout default value, it is too lower in my case (1 minute). I added in the web.config following elements within Binding tag and now it works fine:

<binding name="customBinding"
    closeTimeout="00:01:00" openTimeout="00:01:00" 
    receiveTimeout="00:10:00" sendTimeout="00:10:00">
</binding>
-2
votes

check whether reader quota is there in your web.config also change ResponseFormat in json