0

928mb file works ok, but this overflow error happens when I try to send 1.08GB to the soap service (mtom chunked transfer, _service reference.cs is generated from wsdl). In the fiddler tracing I see only headers of the request, but no request body and no response

Relevant code:

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);

And the error stacktrace is as follows:

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 

I cant debug this further than to the PostFile() call, so my question is - where does the error occur, in the server or on my client? and of course how to go about fixing it? Thanks!

Succenna
  • 25
  • 2
  • `Server stack trace:` problem is at the server –  Apr 12 '17 at 11:19
  • Thanks, it would be an answer if you could also tell me how to go about explaining it to the service provider where the error occurs? Usually I get soap fault message I can send them for review, but no response in this case – Succenna Apr 12 '17 at 11:51
  • what is happening here? C:\MyServiceClient\Reference.cs:line 8473 –  Apr 12 '17 at 12:26
  • Line 8473 is: return base.Channel.PostFile(request); – Succenna Apr 12 '17 at 12:42
  • It's server side. If you do not have access to the server code there is nothing you can do. See answer for advice. –  Apr 12 '17 at 12:44

1 Answers1

0

From in the stack trace it is telling you that it is server side:

Server stack trace:

The error is caused by something which is happening at:

at MyServiceClient.FileuploadSoapPortType.PostFile(UploadRequest request) in C:\MyServiceClient\Reference.cs:line 8473 

Access that file and see what is happening on that line. I'd like to think where ever the web service is hosted they have logs for when something like this occurs.

To find out why I suggest:

  • giving the time it occured ( if they have logs its easier to find the stack trace)
  • Detailed description of what you tried to do when the error occurred.