Hi there.
Did you manage to find a fix?
I am seeing something very similar with MTOM + WSE3. I have modified the
WSE 3 sample "BinaryDataMTOM" so that the sample method RunPutStreaming tries
to upload a very large file(200MB). I am running the client and the server
within Visual Studio on the same physical host.
Like you, I have also adjusted the web.config and machine.config files to
include:
<httpRuntime maxRequestLength="200000" useFullyQualifiedRedirectUrl="true"
executionTimeout="5000" />
and I've also added this to my web.config:
<messaging>
<mtom serverMode="optional" />
<maxMessageLength value="1024000" />
</messaging>
I can successfully send a file of 5MB to the server, but with 200MB I get
this exception:
A first chance exception of type 'System.OutOfMemoryException' occurred in
Microsoft.Web.Services3.dll
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException'
was thrown.
at System.String.GetStringForStringBuilder(String value, Int32
startIndex, Int32 length, Int32 capacity)
at System.Convert.ToBase64String(Byte[] inArray, Int32 offset, Int32
length, Base64FormattingOptions options)
at System.Convert.ToBase64String(Byte[] inArray)
at Microsoft.Web.Services3.Mime.XopNodeData.GetString ()
at Microsoft.Web.Services3.Mime.XopContentsNode.get_D ata()
at System.Xml.XmlText.get_Value()
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportChildren(XmlNode fromNode, XmlNode
toNode, Boolean deep)
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportChildren(XmlNode fromNode, XmlNode
toNode, Boolean deep)
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportChildren(XmlNode fromNode, XmlNode
toNode, Boolean deep)
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportChildren(XmlNode fromNode, XmlNode
toNode, Boolean deep)
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportChildren(XmlNode fromNode, XmlNode
toNode, Boolean deep)
at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)
at System.Xml.XmlDocument.ImportNode(XmlNode node, Boolean deep)
at Microsoft.Web.Services3.SoapFilter.CreateTraceEntr y(Type processor,
String description, XmlNode content)
at Microsoft.Web.Services3.Pipeline.ProcessOutputMess age(SoapEnvelope
envelope)
at Microsoft.Web.Services3.Xml.SoapEnvelopeWriter.Fin ish()
at Microsoft.Web.Services3.Xml.XmlWrappingWriter.Flus h()
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Serialize(SoapClientMessage message)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at
localhost.BinaryDataMTOMServiceWse.PutFileStreamin g(GetFileRequestStreaming
getFileResponseStreaming) in C:\Program Files\Microsoft
WSE\v3.0\Samples\CS\QuickStart\Basic\BinaryDataMTO M\BinaryDataMTOMClient\Web
References\localhost\Reference.cs:line 148
at BinaryDataMTOMClient.BinaryDataMTOMClient.RunPutSt reaming() in
C:\Program Files\Microsoft
WSE\v3.0\Samples\CS\QuickStart\Basic\BinaryDataMTO M\BinaryDataMTOMClient\BinaryDataMTOMClient.cs:lin e 148
at BinaryDataMTOMClient.BinaryDataMTOMClient.Main(Str ing[] args) in
C:\Program Files\Microsoft
WSE\v3.0\Samples\CS\QuickStart\Basic\BinaryDataMTO M\BinaryDataMTOMClient\BinaryDataMTOMClient.cs:lin e 66
Can anyone offer a suggestion please?
Thanks.
"DBC User" wrote:
Hi,
I am using MTOM and WSE 2.0 and trying to upload a file which is
almost 70MB (big). I have setup the timeout to a good size and file
size limit to 100MB in the server. The uploading is coming through T3
pipe. Even with all the changes, I get a 'out of memory' error. Can
someone help?
In my code, I am reading the file into a byte array. I don't think
reading the byte array has any problem.
Following is the actual exception
System.OutOfMemoryException: Exception of type
'System.OutOfMemoryException' was thrown.
at System.String.GetStringForStringBuilder(String value, Int32
startIndex, Int32 length, Int32 capacity)
at System.Convert.ToBase64String(Byte[] inArray, Int32 offset,
Int32 length, Base64FormattingOptions options)
at System.Convert.ToBase64String(Byte[] inArray)
at Microsoft.Web.Services3.Mime.XopNodeData.GetString ()
at Microsoft.Web.Services3.Mime.XopContentsNode.get_D ata()
at System.Xml.XmlText.get_Value()
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.WriteElement(XmlElement
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.WriteElement(XmlElement
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.WriteElement(XmlElement
node)
at
Microsoft.Web.Services3.Security.Xml.ElementCanoni calizationDispatcher.Write(XmlNode
node)
at
Microsoft.Web.Services3.Security.Xml.Canonicalizat ionDriver.WriteTo(CanonicalEncoder
encoder)
at
Microsoft.Web.Services3.Security.Xml.XmlDsigExcC14 NTransform.GetHashedOutput(HashAlgorithm
hash)
at
Microsoft.Web.Services3.Security.TransformChain.Tr ansformAndHash(Object
inputObject, HashAlgorithm algorithm)
at
Microsoft.Web.Services3.Security.SignatureReferenc e.CalculateHashValue(XmlDocument
document, CanonicalXmlNodeList refList)
at
Microsoft.Web.Services3.Security.MessageSignature. BuildDigestedReferences()
at
Microsoft.Web.Services3.Security.MessageSignature. ComputeKeyedHashSignature(SymmetricKeyAlgorithm
key)
at
Microsoft.Web.Services3.Security.MessageSignature. ComputeSignature()
at
Microsoft.Web.Services3.Security.Security.Serializ eXml(SoapEnvelope
document)
at
Microsoft.Web.Services3.Security.SecurityOutputFil ter.ProcessHeader(Security
security, SoapEnvelope envelope)
at
Microsoft.Web.Services3.Security.SecurityOutputFil ter.ProcessMessage(SoapEnvelope
envelope)
at
Microsoft.Web.Services3.Security.Wse2PipelinePolic y.LegacyFilterWrapper.ProcessMessage(SoapEnvelope
envelope)
at
Microsoft.Web.Services3.Pipeline.ProcessOutputMess age(SoapEnvelope
envelope)
at Microsoft.Web.Services3.Xml.SoapEnvelopeWriter.Fin ish()
at Microsoft.Web.Services3.Xml.XmlWrappingWriter.Flus h()
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Serialize(SoapClientMessage
message)
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)