0
928mb文件可以正常工作,但是当我尝试向soap服务发送1.08GB时发生此溢出错误(mtom chunked transfer,_service reference.cs从wsdl生成)。在提琴手跟踪我看到的只是请求的头,但没有要求的身体也没有反应C#soap客户端System.OverflowException:算术运算导致溢出
相关代码:
var httpsTransportBindingElement = new HttpsTransportBindingElement
{
MaxReceivedMessageSize = int.MaxValue,
TransferMode = TransferMode.Streamed //Chunked transfer
};
var binding = new CustomBinding();
var mtomEncoding = new MtomMessageEncodingBindingElement(MessageVersion.Soap12, Encoding.UTF8);
mtomEncoding.ReaderQuotas.MaxStringContentLength = int.MaxValue;
binding.Elements.Add(mtomEncoding);
binding.Elements.Add(httpsTransportBindingElement);
binding.SendTimeout = TimeSpan.FromHours(1);
binding.ReceiveTimeout = TimeSpan.FromMinutes(5);
_service = new FileuploadSoapPortTypeClient(binding, new EndpointAddress(configuration.HttpUploadUrl));
_service.PostFile(request);
和错误堆栈跟踪如下:
System.OverflowException: Arithmetic operation resulted in an overflow.
Server stack trace:
at System.IO.BufferedStream.Write(Byte[] array, Int32 offset, Int32 count)
at System.Xml.XmlMtomWriter.WriteXOPBinaryParts()
at System.ServiceModel.Channels.Message.WriteMessagePostamble(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.MtomMessageEncoder.WriteMessage(Message message, Stream stream, String startInfo, String boundary, String startUri, Boolean writeMessageHeaders)
at System.ServiceModel.Channels.HttpOutput.WriteStreamedMessage(TimeSpan timeout)
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at MyServiceClient.FileuploadSoapPortType.PostFile(UploadRequest request)
at MyServiceClient.FileuploadSoapPortType.PostFile(UploadRequest request) in C:\MyServiceClient\Reference.cs:line 8473
我不能除PostFile()调用外,进一步调试,所以我的问题是 - 错误发生在服务器还是我的客户端?当然如何去解决它?谢谢!
'服务器堆栈跟踪:'问题是在服务器 –
谢谢,这将是一个答案,如果你也能告诉我如何去解释它的地方出现错误的服务提供商?通常我会收到肥皂故障信息,我可以将它们发送给他们进行审查,但在这种情况下没有回应 – Succenna
这里发生了什么? C:\ MyServiceClient \ Reference.cs:line 8473 –