Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WCF捕获maxReceivedMessageSize错误_C#_Wcf - Fatal编程技术网

C# WCF捕获maxReceivedMessageSize错误

C# WCF捕获maxReceivedMessageSize错误,c#,wcf,C#,Wcf,尝试向我的WCF服务发送大文件时,我遇到以下错误: 400 - http://myservice/newfilebiggie Date: Thu, 25 Feb 2016 09:51:42 GMT Execution Time (ms): 21477.116 Content-Type: text/html Content-Length: -1 Body: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC

尝试向我的WCF服务发送大文件时,我遇到以下错误:

400 - http://myservice/newfilebiggie
Date: Thu, 25 Feb 2016 09:51:42 GMT
Execution Time (ms): 21477.116
Content-Type: text/html
Content-Length: -1

Body:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Request Error</title>
    <style>BODY
{
     color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px;
} #content
{
     margin-left: 30px; font-size: .70em; padding-bottom: 2em;
} A:link
{
     color: #336699; font-weight: bold; text-decoration: underline;
} A:visited
{
     color: #6699cc; font-weight: bold; text-decoration: underline;
} A:active
{
     color: #336699; font-weight: bold; text-decoration: underline;
} .heading1
{
     background-color: #003366; border-bottom: #336699 6px solid; color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal;margin: 0em 0em 10px -20px; padding-bottom: 8px; padding-left: 30px;padding-top: 16px;
} pre
{
     font-size:small; background-color: #e5e5cc; padding: 5px; font-family: Courier New; margin-top: 0px; border: 1px #f0f0e0 solid; white-space: pre-wrap; white-space: -pre-wrap; word-wrap: break-word;
} table
{
     border-collapse: collapse; border-spacing: 0px; font-family: Verdana;
} table th
{
     border-right: 2px white solid; border-bottom: 2px white solid; font-weight: bold; background-color: #cecf9c;
} table td
{
     border-right: 2px white solid; border-bottom: 2px white solid; background-color: #e5e5cc;
}</style>
  </head>
  <body>
    <div id="content">
      <p class="heading1">Request Error</p>
      <p>The server encountered an error processing the request. The exception message is 'The maximum message size quota for incoming messages (10485760) has been exceeded. To increase the quota,
use the MaxReceivedMessageSize property on the appropriate binding element.'. See server logs for more details. The exception stack trace is: </p>
      <p>   at System.ServiceModel.Channels.MaxMessageSizeStream.PrepareRead(Int32 bytesToRead)
   at System.ServiceModel.Channels.MaxMessageSizeStream.Read(Byte
[
] buffer,
Int32 offset,
Int32 count)
   at System.IO.BufferedStream.Read(Byte
[
] array,
Int32 offset,
Int32 count)
   at System.Runtime.Serialization.Json.JsonEncodingStreamWrapper.Read(Byte
[
] buffer,
Int32 offset,
Int32 count)
   at System.Xml.XmlBufferReader.TryEnsureBytes(Int32 count)
   at System.Runtime.Serialization.Json.XmlJsonReader.ReadNumericalText()
   at System.Runtime.Serialization.Json.XmlJsonReader.Read()
   at System.Xml.XmlBaseReader.ReadStartElement()
   at System.Xml.XmlDictionaryReader.ReadElementContentAsInt()
   at System.Runtime.Serialization.Json.ByteArrayHelperWithString.ReadArray(XmlDictionaryReader reader,
String localName,
String namespaceUri,
Byte
[
] array,
Int32 offset,
Int32 count)
   at System.Xml.ArrayHelper`2.ReadArray(XmlDictionaryReader reader,
TArgument localName,
TArgument namespaceUri,
Int32 maxArrayLength)
   at System.Runtime.Serialization.Json.JsonReaderDelegator.ReadContentAsBase64()
   at System.Runtime.Serialization.Json.JsonReaderDelegator.ReadElementContentAsBase64()
   at ReadResumeUploadDTOFromJson(XmlReaderDelegator ,
XmlObjectSerializerReadContextComplexJson ,
XmlDictionaryString ,
XmlDictionaryString
[
] )
   at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader,
XmlObjectSerializerReadContextComplexJson context)
   at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract dataContract,
XmlReaderDelegator reader)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader,
String name,
String ns,
Type declaredType,
DataContract&amp; dataContract)
   at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader,
Type declaredType,
DataContract dataContract,
String name,
String ns)
   at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader,
Boolean verifyObjectName)
   at System.Runtime.Serialization.XmlObjectSerializer.InternalReadObject(XmlReaderDelegator reader,
Boolean verifyObjectName,
DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader,
Boolean verifyObjectName,
DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader,
Boolean verifyObjectName)
   at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.ReadObject(Message message)
   at System.ServiceModel.Dispatcher.SingleBodyParameterDataContractMessageFormatter.ReadObject(Message message)
   at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.DeserializeRequest(Message message,
Object
[
] parameters)
   at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message,
Object
[
] parameters)
   at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message,
Object
[
] parameters)
   at System.ServiceModel.Dispatcher.CompositeDispatchFormatter.DeserializeRequest(Message message,
Object
[
] parameters)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</p>
    </div>
  </body>
</html>
400-http://myservice/newfilebiggie
日期:2016年2月25日星期四09:51:42 GMT
执行时间(毫秒):21477.116
内容类型:text/html
内容长度:-1
正文:
请求错误
身体
{
颜色:#000000;背景颜色:白色;字体系列:Verdana;左边距:0px;右边距顶部:0px;
}#内容
{
左边距:30px;字体大小:70em;填充底部:2em;
}A:链接
{
颜色:#336699;字体大小:粗体;文字装饰:下划线;
}A:参观了
{
颜色:#6699cc;字体大小:粗体;文字装饰:下划线;
}A:主动的
{
颜色:#336699;字体大小:粗体;文字装饰:下划线;
}.标题1
{
背景色:#003366;边框底部:#336699 6px实心;颜色:#ffffff;字体系列:Tahoma;字体大小:26px;字体重量:正常;边距:0em 0em 10px-20px;填充底部:8px;填充左侧:30px;填充顶部:16px;
}前
{
字体大小:小;背景颜色:#e5cc;填充:5px;字体系列:Courier New;页边空白顶部:0px;边框:1px#f0f0e0实心;空白:预换行;空白:-预换行;换行字:打断字;
}桌子
{
边框折叠:折叠;边框间距:0px;字体系列:Verdana;
}表th
{
右边框:2倍白色纯色;边框底部:2倍白色纯色;字体粗体;背景色:#cecf9c;
}表td
{
右边框:2倍白色纯色;边框底部:2倍白色纯色;背景色:#E5cc;
}
请求错误

服务器在处理请求时遇到错误。异常消息为“已超过传入消息(10485760)的最大消息大小配额。”。增加配额,, 对相应的绑定元素使用MaxReceivedMessageSize属性。“。有关详细信息,请参阅服务器日志。异常堆栈跟踪为:

位于System.ServiceModel.Channels.MaxMessageSizeStream.PrepareRead(Int32 bytesToRead) 位于System.ServiceModel.Channels.MaxMessageSizeStream.Read(字节 [ ]缓冲器, Int32偏移量, Int32计数) 在System.IO.BufferedStream.Read(字节 [ ]阵列, Int32偏移量, Int32计数) 在System.Runtime.Serialization.Json.JsonEncodingStreamWrapper.Read(字节 [ ]缓冲器, Int32偏移量, Int32计数) 在System.Xml.XmlBufferReader.TryEnsureBytes处(Int32计数) 在System.Runtime.Serialization.Json.XmlJsonReader.ReadNumericalText()中 在System.Runtime.Serialization.Json.XmlJsonReader.Read()中 位于System.Xml.XmlBaseReader.ReadStartElement()处 位于System.Xml.XmlDictionaryReader.ReadElementContentAsInt()处 在System.Runtime.Serialization.Json.ByteArrayHelpPerWithString.ReadArray(XmlDictionaryReader reader, 字符串localName, 字符串namespaceUri, 字节 [ ]阵列, Int32偏移量, Int32计数) 在System.Xml.ArrayHelper`2.ReadArray(XmlDictionaryReader reader, targetLocalName, target名称空间URI, Int32最大阵列长度) 在System.Runtime.Serialization.Json.JsonReaderDelegator.ReadContentAsBase64()中 在System.Runtime.Serialization.Json.JsonReaderDelegator.ReadElementContentAsBase64()中 在ReadResumeUploadDTOFromJson(XmlReaderDelegator, XmlObjectSerializerReadContextComplexJson, 这是我的梦想, XmlDictionaryString [ ] ) 在System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson上下文) 在System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract DataContract, XmlReaderDelegator阅读器) 在System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, 字符串名, 字符串ns, 类型declaredType, 数据合同和数据合同) 在System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, 类型declaredType, 数据合同数据合同, 字符串名, 字符串(ns) 在System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader, 布尔验证对象(名称) 在System.Runtime.Serialization.XmlObjectSerializer.InternalReadObject(XmlReaderDelegator阅读器, 布尔验证对象名, DataContractResolver(DataContractResolver) 在System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, 布尔验证对象名, DataContractResolver(DataContractResolver) 在System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader, 布尔验证对象(名称) 位于System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.ReadObject(消息消息) 位于System.ServiceModel.Dispatcher.SingleBodyParameterDataContractMessageFormatter.ReadObject(消息消息) 在System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.DeserializeRequest(消息, 对象 [ ]参数) 在System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(消息消息, 对象 [ ]参数) 在System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(消息, 对象 [ ]参数) 在System.ServiceModel.Dispatcher.CompositeDispatchFormatter.DeserializeRequest(消息, 对象 [ ]参数) 位于System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&;rpc) 位于System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&;rpc) 位于System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&;rpc) 位于System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&;rpc) 位于System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&;rpc) 位于System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&;rpc) 位于System.ServiceModel.Dispatcher.ImmutableDispatcheRuntime.ProcessMessage3(MessageRpc&;rpc)