views:

45

answers:

1

I am seeing a problem where I send large messages over wcf net.msmq using protobuf-net and get the following error:

The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'DeliverData'. End element 'proto' from namespace 'http://mynamespace' expected

If message size is under 16k, it works

If I remove protobuf-net, it works

If I switch to basichttp, it works

But if message size is over 16k, using protobuf-net, over net.msmq, I get the error. I have set maxBufferPoolSize and maxReceivedMessageSize sufficiently large, it does not help.

Has anyone else seen this? Has anyone else used protobuf-net + net.msmq for large messages and gotten it to work?

A: 

Apologies for the delay - holiday etc. No, I haven't seen a specific problem with that. The fact that it calls out the "End element" suggests that it is in the xml layer at the time (which is before protobuf-net really gets involved). Do you have any way that I could reliably reproduce this?


After investigation, the problem here appears to be a WCF's reader-quotas; the exception appears to be swallowed by MSMQ, so wasn't immediately obvious. This can be fixed in configuration, or in code (if you are setting up your bindings manually) by referencing System.Runtime.Serialization and increasing the binding's .ReaderQuotas.MaxArrayLength appropriately. The maximum allowed value is 2147483647.

Marc Gravell
Thanks for the response. I have emailed you sample code that demonstrates the problem
fatweasel
@fatweasel - updated
Marc Gravell
That works, thanks!
fatweasel