首页 新闻 会员 周边 捐助

设置 maxReceivedMessageSize 还是提示 超过 65536的 配额

0
[待解决问题]

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>131075</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2013-04-27T01:26:30.4812396Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="RelayServer" ProcessID="5316" ThreadID="3" /><Channel/><Computer>RAINY</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/zh-CN/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier><Description>正在引发异常。</Description><AppDomain>RelayServer.exe</AppDomain><Exception><ExceptionType>System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。</Message><StackTrace>   在 System.ServiceModel.Channels.ClientDuplexConnectionReader.DecodeMessage(Byte[] buffer, Int32&amp;amp; offset, Int32&amp;amp; size, Boolean&amp;amp; isAtEOF, TimeSpan timeout)

------------------------------------------------------------------- 配置如下:

<services>
            <!--name - 提供服务的类名-->
            <!--behaviorConfiguration - 指定相关的行为配置-->
            <service name="RelayServer.Relay" behaviorConfiguration="BindingBehavior">
                <!--address - 服务地址-->
                <!--binding - 通信方式-->
                <!--contract - 服务契约-->
                <!--<endpoint binding="basicHttpBinding" contract="WCF.ServiceLib.Binding.IHello" address="Hello" />-->
                <endpoint binding="wsHttpBinding"  bindingConfiguration="NoneSecurity" contract="WCF.RelayLib.Binding.IRelay" address="Relay"/>
                <!--元数据交换的endpoint-->
                <!--注:address是mex,它会和host/baseAddresses节点中的baseAddress做拼接,即提供元数据交换的地址为:http://localhost:12345/Binding/mex-->
                <!--<endpoint binding="mexHttpBinding" contract="IMetadataExchange" address="mex" />-->
                <host>
                    <baseAddresses>  
                        <add baseAddress="http://localhost:54322/Binding/"/>
                    </baseAddresses>
                </host>
            </service>
        </services>
        <bindings>
            <wsHttpBinding>
                <binding name="NoneSecurity" maxReceivedMessageSize="2147483647" receiveTimeout="12:00:00" useDefaultWebProxy="false">
                    <readerQuotas maxStringContentLength="2147483647" />
                    <reliableSession inactivityTimeout="12:00:00"/>
                    <security mode="None"/>
                </binding>
            </wsHttpBinding>
        </bindings>

wcf
Rainyabc的主页 Rainyabc | 菜鸟二级 | 园豆:204
提问于:2013-04-27 09:32
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册