常常遇到的报错:

1.错误一:

Error in deserializing body of reply message for operation 'GetArticleInfo'.,StackTrace=
Server stack trace:
at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
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 sunflower.ui.web.KbaseServiceReference.KbaseWebServicesSoap.GetArticleInfo(String itemId, String dBType, String dBName)
at sunflower.ui.web.Utils.ArticleKbaseUtils.GetArticleViewModel(String filename, String dbType),Source=mscorlib,

错误二:

 The formatter threw an exception WHILE trying TO deserialize the message: There was an error WHILE trying TO deserialize parameter http://tempuri.org/:GetArticleInfoResponse. The InnerException message was 'There was an error deserializing the object of type sun.ui.web.baseServiceReference.GetArticleInfoResponseBody. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 17144.'.  Please see InnerException FOR more details.,StackTrace=
SERVER stack trace: 
   AT System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, BOOLEAN isRequest)
   AT System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameter(XmlDictionaryReader reader, PartInfo part, BOOLEAN isRequest)
   AT System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, BOOLEAN isRequest)
   AT System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion VERSION, STRING ACTION, MessageDescription messageDescription, Object[] parameters, BOOLEAN isRequest)
   AT System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, BOOLEAN isRequest)
   AT System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters)
   AT System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc)
   AT System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   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 sunflower.ui.web.KbaseServiceReference.KbaseWebServicesSoap.GetArticleInfo(GetArticleInfoRequest request)
   AT sunflower.ui.web.KbaseServiceReference.KbaseWebServicesSoapClient.sunflower.ui.web.KbaseServiceReference.KbaseWebServicesSoap.GetArticleInfo(GetArticleInfoRequest request)
   AT sunflower.ui.web.KbaseServiceReference.KbaseWebServicesSoapClient.GetArticleInfo(STRING itemId, STRING dBType, STRING dBName)
   AT sunflower.ui.web.Utils.ArticleKbaseUtils.GetArticleViewModel(STRING filename, STRING dbType),Source=mscorlib,

。。。

我解决此问题采用的办法是修改配置节点为下面的样子,显示声明配额,增大配置值,增加readerQuotas 节点

web.config中修改为:

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="RECInterfaceSoap" />
        <binding name="baseWebServicesSoap" maxBufferPoolSize="2147483647"  maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
        </binding>        
      </basicHttpBinding>
      
    </bindings>
    <client>
      <endpoint address="http://127.0.0.1/service/interface.asmx"
        binding="basicHttpBinding" bindingConfiguration="RECInterfaceSoap"
        contract="ecpServiceReference.RECInterfaceSoap" name="RECInterfaceSoap" />
      <endpoint address="http://127.0.0.1:8470/base/baseWebServices.asmx"
        binding="basicHttpBinding" bindingConfiguration="baseWebServicesSoap"
        contract="baseServiceReference.baseWebServicesSoap" name="baseWebServicesSoap" />
    </client>
    <behaviors>
       <serviceBehaviors>
           <behavior name="baseServiceReference.baseWebServicesSoap">
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
              <dataContractSerializer maxItemsInObjectGraph="2147483647"/>     
        </behavior>        
      </serviceBehaviors>     
    </behaviors>
  </system.serviceModel> 

访问WebServcie遇到配额不足的时候,请增加配额的更多相关文章

  1. 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。

    错误:已超过传入消息(65536)的最大消息大小配额.若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性. 或者 错误:反序列化操作“GetAllUserData ...

  2. 调用WCF时,调用已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定。

    解决方案: 其实只要在客户端配置文件中加上如下紫色粗体属性( maxReceivedMessageSize): <?xml version="1.0" encoding=&q ...

  3. WebService 之 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。

    在使用 WCF 中,遇到如下问题: 已超过传入消息(65536)的最大消息大小配额.若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性. 问题说明: 客户端调用 ...

  4. WORKGROUP无法访问,您可能没有权限使用网络资源,请与这台服务器的管理员联系以....

    解决方法 1.启用Guest账号 在很多情况下,为了本机系统的安全,Guest账户是被禁用的,这样就无法访问该机器的共享资源,因此必须启用Guest账户. 笔者以Windows XP系统为例进行介绍. ...

  5. WCF已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性

    <?xml version="1.0" encoding="utf-8"?> <configuration> <connectio ...

  6. WCF 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性

    我出现这个问题主要是服务器返回数据量过大引起了,需要客户端服务端都要进行配置:我会说其实有神器的么....(工具=>wcf服务配置编辑器),用工具编辑下,就会完全搞定这个问题,再也不用纠结了 服 ...

  7. WCF请求数据:已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。

    通常情况下,写好WCF服务后都会用自带的WCFClient工具进行测试,在进行时数据请求的时候,如果返回数据量超过默认接收值的时候就会提示如图异常错误. 错误也提示的很清楚,无非就是修改接收值大小的问 ...

  8. System.ServiceModel.CommunicationException: 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。

  9. TP3.2 APP_DEBUG=false关闭调试后访问不了。页面错误!请稍后再试~

    在APP_DEBUG=true时是没问题的,在APP_DEBUG=false时才会出现找不到模板的问题.  经过排查可能是模板文件找不到问题,之前是这么写的. 改为这个就好了. ----------- ...

随机推荐

  1. python中求两个List的交集、并集和差集

    直接上代码,有三种方法,第三种调用库函数效率最高 # ! /usr/bin/env python # encoding:utf-8 if __name__ == '__main__': a = [1, ...

  2. 浏览器唤起APP的思路(本文转载)

    在做 h5 页面中,会遇到这样一个需求,有一个立即打开的按钮,如果本地安装了我们的 app,那么点击就直接唤起本地 app,如果没有安装,则跳转到下载. 首先想到的是两个问题:一是如何唤起本地 app ...

  3. swift 获取Documnets 的路径 和 CGD 延迟

    // CGD 延迟 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64( * NSEC_PER_SEC)), dispatch_get_main ...

  4. 学习BOS物流项目第九天

    1 教学计划 1.业务受理需求分析 a. 业务通知单 b.工单 c.工作单 2.创建业务受理环节的数据表 a.业务通知单 b.工单 c.工作单 3.实现业务受理自动分单 a.在CRM服务端扩展方法根据 ...

  5. OTU(operational taxonomic units),即操作分类单元

    转自http://www.dxy.cn/bbs/topic/35655953 1.OTU是什么? OTU(operational taxonomic units),即操作分类单元.通过一定的距离度量方 ...

  6. C#实现将字符串作为表达式运算

    转载:http://blog.csdn.net/lifeforcode/article/details/2010807 曾经有个需求,要把一段字符串作为C#的一段语句来执行.说实在了,就类似实现计算器 ...

  7. GsonFormat的使用 (转)

    一.Android Studio快速添加Gson 具体操作:        1.File->Project Structure:   2.app->Dependencies->&qu ...

  8. NumPy 从已有的数组创建数组

    NumPy 从已有的数组创建数组 本章节我们将学习如何从已有的数组创建数组. numpy.asarray numpy.asarray 类似 numpy.array,但 numpy.asarray 只有 ...

  9. Maximum Gap (ARRAY - SORT)

    QUESTION Given an unsorted array, find the maximum difference between the successive elements in its ...

  10. c#的Boolean.Parse用法

    bool val; string input; input = bool.TrueString; val = bool.Parse(input); Console.WriteLine("'{ ...