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 –