调用WCF传大于8K的字符串就异常,wcf一分钟报超时异常(在线等!!!)

red_guitar 2011-11-30 09:26:05
两个异常均是超过wcf默认配置设置,但是wcf的配置已经改得够大了,还是一样异常(重新生成过wcf,更新过wcf引用)
服务端配置:

<bindings >

<basicHttpBinding>
<binding name ="basicHttpBinding" maxReceivedMessageSize="2147483647" sendTimeout="00:10:00" maxBufferSize="2147483647" >
<readerQuotas maxStringContentLength="2147483647"/>
<security mode="None"></security>
</binding>

</basicHttpBinding>

</bindings>


客户端配置:

<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="flowbinding" sendTimeout="00:10:00" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" />
<security mode="None">
<transport realm="" />
</security>
</binding>
</basicHttpBinding>
<customBinding>
<binding name="flowbinding">
<textMessageEncoding messageVersion="Default" writeEncoding="utf-8" />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://localhost:2449/JPMFlowService.svc"
binding="basicHttpBinding" bindingConfiguration="flowbinding"
contract="FlowService.IJPMFlowService" name="BasicHttpBinding_IJPMFlowService" />
</client>
</system.serviceModel>
</configuration>
...全文
255 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
red_guitar 2011-12-01
  • 打赏
  • 举报
回复
一语惊醒梦中人。。。。悲催[Quote=引用 5 楼 chenlilinman 的回复:]
服务端参考如下配置
XML code

<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service behaviorConfiguration="ESBServiceBehavior" name="……
[/Quote]
赳赳老陈 2011-11-30
  • 打赏
  • 举报
回复
服务端参考如下配置

<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service behaviorConfiguration="ESBServiceBehavior" name="MDService">
<endpoint binding="wsHttpBinding" bindingConfiguration="wsESBHttpBinding" contract="IMDService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsESBHttpBinding" maxReceivedMessageSize="655360">
<readerQuotas maxStringContentLength="655360"/>
<security mode="None"/>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ESBServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceThrottling maxConcurrentCalls="1024" maxConcurrentSessions="1024"
maxConcurrentInstances="1024" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>


其中的wsESBHttpBinding需要配置到MDService服务上才能生效,如:
bindingConfiguration="wsESBHttpBinding"
赳赳老陈 2011-11-30
  • 打赏
  • 举报
回复
主要问题应该出在服务端的配置上 你的那个配置根本没起作用
red_guitar 2011-11-30
  • 打赏
  • 举报
回复
格式化程序尝试对消息反序列化时引发异常: 对操作“UpdateFlow”的请求消息正文进行反序列化时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。通过更改在创建 XML 读取器时所使用的 XmlDictionaryReaderQuotas 对象的 MaxStringContentLength 属性,可增加此配额。 行 55,位置 50。
[Quote=引用 1 楼 chenlilinman 的回复:]

详细的错误信息贴出来看一下先
[/Quote]
赳赳老陈 2011-11-30
  • 打赏
  • 举报
回复
详细的错误信息贴出来看一下先

12,166

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧