| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4994 人关注过本帖
标题:传输超过8K的XML的问题。
只看楼主 加入收藏
zzzman
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-12-11
收藏
 问题点数:0 回复次数:1 
传输超过8K的XML的问题。
在请求超过8K的XML配置文件时,总会出现:
反序列化操作“generateSecnodXMLData”的响应消息的正文时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。通过更改在创建 XML 读取器时所使用的 XmlDictionaryReaderQuotas 对象的 MaxStringContentLength 属性,可增加此配额。 行 1,位置 10056。

这样的出错提示,是什么原因呢?我将web.config的配制写成如下,但不能解决问题。向大家请教,如何能解决呢?


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

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>

    <services>
      <service  name="Services.XMLMenuDataService">
        <endpoint address="/services/XMLMenuDataService.svc" binding="basicHttpBinding" bindingConfiguration="basicHB"  contract="Services.IXMLMenuDataService">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>


    <bindings>
      <basicHttpBinding>
        <binding name="basicHB" maxReceivedMessageSize="67000000" >
          <readerQuotas maxStringContentLength="67000000" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false 并删除上面的元数据终结点 -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>
搜索更多相关主题的帖子: 原因 version 配置文件 字符串 
2012-12-11 15:17
sunpro1
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-2-16
收藏
得分:0 
我是用byte[]传输的
2013-02-16 09:34
快速回复:传输超过8K的XML的问题。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011003 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved