OutOfMemory error when downloading TM from WorldServer

Hi,

I'm receiving an OutOfMemoryException when downloading a TM containing 359 TUs from WorldServer using its client API. The export finished successfully, but the download fails:

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.IO.MemoryStream.set_Capacity(Int32 value)
   at System.IO.MemoryStream.EnsureCapacity(Int32 value)
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at Microsoft.Web.Services2.StreamHelper.BinaryCopy(Stream from, Stream to, Int32 bufferSize)
   at Microsoft.Web.Services2.Dime.DimeAttachmentCollection..ctor(DimeReader reader)
   at Microsoft.Web.Services2.Messaging.SoapDimeFormatter.Microsoft.Web.Services2.Messaging.ISoapFormatter.Deserialize(Stream stream)
   at Microsoft.Web.Services2.InputStream.GetRawContent()
   at Microsoft.Web.Services2.InputStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer)
   at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)
   at System.Xml.XmlTextReaderImpl.ReadData()
   at System.Xml.XmlTextReaderImpl.InitTextReaderInput(String baseUriStr, Uri baseUri, TextReader input)
   at System.Xml.XmlTextReaderImpl..ctor(String url, TextReader input, XmlNameTable nt)
   at System.Xml.XmlTextReader..ctor(TextReader input)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.GetReaderForMessage(SoapClientMessage message, Int32 bufferSize)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Com.Idiominc.Webservices.Data.ExchangeWSExportResultService.download(String token, ExchangeWSExportResult wSExportResult, String attachedFileResult)
   at Com.Idiominc.Webservices.Client.Exchange.WSExportResult.download(String attachedFileResult)

can you please help if there is a solution for this?

The strange is that we had to increase the maximum message size to 400MB (!) in the app.config to avoid other message size exceptions.

Thanks,

Tamas