【发布时间】:2014-10-06 00:33:57
【问题描述】:
我在服务器端创建 WCF 服务以返回文件的二进制(字节).. 我只能返回 txt 文件的二进制文件,否则会显示“已超出传入消息的最大消息大小配额 (65536)。要增加配额,请在适当的绑定元素上使用 MaxReceivedMessageSize 属性。”
<bindings>
<basicHttpBinding>
<binding name="basicHttp" allowCookies="true"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
transferMode="Buffered"
messageEncoding="Text"
textEncoding="utf-8"
bypassProxyOnLocal="false"
useDefaultWebProxy="true" >
<security mode="None" />
<readerQuotas maxDepth="2147483647"
maxArrayLength="2147483647"
maxStringContentLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
你能给我解决办法吗?
我需要你的帮助..谢谢之前:)
这里是客户端代码端(app.config)
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:3724/Service.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService"
contract="ServiceReference1.IService"
name="BasicHttpBinding_IService" />
</client>
此客户端是桌面应用程序而不是网站
【问题讨论】:
-
@Tim 我把标签端点放在哪里? :)
-
@PeterYohanes 它应该是配置文件中的另一个部分。您可以在此处为您的服务指定服务 ABC - 地址、绑定、合同。
-
@GalacticCowboy 我在绑定标签之后制作端点标签..但它错误..对不起,我以前从未使用过它。所以我很困惑应用它..