【发布时间】:2011-09-22 10:16:42
【问题描述】:
我需要通过 WCF 服务传递超过 64kb 的数据。为此,我通过以下方式配置了服务器端(托管 WCF 服务):
<services>
<service name="MyService" behaviorConfiguration="MyServiceBehavior" >
<endpoint address="" binding="customBinding" contract="MyContract"
bindingName="testBinding" bindingConfiguration="testBinding" />
<endpoint address="mex" binding="customBinding" contract="IMetadataExchange"
bindingName="testBinding" bindingConfiguration="testBinding" />
</service>
</services>
<bindings>
<customBinding>
<binding name="testBinding" >
<textMessageEncoding>
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</textMessageEncoding>
<httpTransport transferMode="Buffered"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"/>
</binding>
</customBinding>
</bindings>
和客户端(消费服务):
<client>
<endpoint address="http://localhost:82/MyService.svc"
binding="customBinding" bindingConfiguration="testBinding"
contract="MyContract"
name="MyName" />
</client>
<bindings>
<customBinding>
<binding name="testBinding" >
<textMessageEncoding>
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</textMessageEncoding>
<httpTransport transferMode="Buffered"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"/>
</binding>
</customBinding>
</bindings>
当我调用所需的方法时,我收到以下错误:
内容类型 application/soap+xml;服务 http://localhost:82/MyService.svc 不支持 charset=utf-8。客户端和服务绑定可能不匹配。
请指教,我的绑定有什么不匹配的地方?
谢谢。
【问题讨论】:
标签: wcf wcf-binding