Large business object size problem

Large business object size problem

Old forum URL:

cds posted on Thursday, July 08, 2010

Hi All

Using CSLA Light...

I have a problem with calling Save on my business object when it gets over a certain size. The business object represents an "attachment" and so can have an arbitrarily large byte[] as one of its properties.

When I call BeginSave it all works fine until I attach a file that's over a certain size - over about 3MB in this case.

Now, this sounded like the usual problem with the limits on my Binding object being too small, but I've set all of them I can find to int.MaxValue (programmatically). At the server end, I've set MaxBufferSize, MaxReceivedMessageSize, MaxBufferPoolSize, ReaderQuotas.MaxArrayLength, ReaderQuotas.MaxBytesPerRead, ReaderQuotas.MaxStringContentLength to int.MaxValue, and at the Silverlight end I've set MaxBufferSize and MaxReceivedMessageSize to int.MaxValue.

The exception I get is in the References class - on EndUpdate - I get "The remote server returned an error: NotFound". When I look at this in Fiddler, I see the response from the server as being: "ReadResponse() failed: The server did not return a response for this request."

Any clues on what else can be wrong and how to debug this?




RockfordLhotka replied on Thursday, July 08, 2010

If it is "arbitrarily large" you might need to find a different data transfer strategy, possibly including "chunking" the file over the network, or using http upload schemes. The data portal isn't well suited to something like a file transfer.

cds replied on Friday, July 09, 2010

Well, yes, I agree about the "arbitrarily large" thing - but I still need to figure out why it's falling over with a file that's 3.5MB when I've set limits to int.MaxValue - i.e. 2GB.

So why would it be falling over at 3.5MB when it shouldn't be limiting it at that size? That's what I'm really trying to figure out.

RockfordLhotka replied on Friday, July 09, 2010

You aren't hitting an IIS or ASP.NET upload size limit by chance?

cds replied on Friday, July 09, 2010

Ah, maybe that's the case. Thanks - I'll go looking there...

cds replied on Friday, July 09, 2010

Thanks for the tip Rocky - that was it. The maxRequestLength attribute of the httpRuntime element in my web.config file needed adjusting.

Copyright (c) Marimer LLC