none
QuotaExceededException : MaxReceivedMessageSize on HPC RRS feed

  • Question

  • my previous post : http://social.msdn.microsoft.com/Forums/vstudio/en-US/9c07489c-24bf-4671-a63c-2d55eef5737b/wcf-serialization-error-on-hpc-multidimensional-array?forum=wcf#914d1725-d301-463e-8e20-8a763ac522d3

    I refered the above post and I added 'traceListener' in server's config.

    and then, I saw the exception :

    ..... <InnerException> <ExceptionType>System.ServiceModel.QuotaExceededException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType> <Message>The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. </Message> <StackTrace> at System.ServiceModel.Channels.ServerSessionPreambleConnectionReader.ServerFramingDuplexSessionChannel.ServerSessionConnectionReader.DecodeMessage(Byte[] buffer, Int32&amp; offset, Int32&amp; size, Boolean&amp; isAtEof, TimeSpan timeout) at System.ServiceModel.Channels.SessionConnectionReader.DecodeMessage(TimeSpan timeout) at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.ConnectionStream.IOAsyncResult.OnAsyncIOComplete(Object state) at System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback() at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs) at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(SocketError socketError, Int32 bytesTransferred, SocketFlags flags) at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) </StackTrace> <ExceptionString>System.ServiceModel.QuotaExceededException: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.ExceptionString> </InnerException>

    the config on server-side :

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <configSections>
        <sectionGroup name="microsoft.Hpc.Session.ServiceRegistration"
                      type="Microsoft.Hpc.Scheduler.Session.Configuration.ServiceRegistration, Microsoft.Hpc.Scheduler.Session, Version=2.0.0.0, 
    
    Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <section name="service"
                   type="Microsoft.Hpc.Scheduler.Session.Configuration.ServiceConfiguration, Microsoft.Hpc.Scheduler.Session, Version=2.0.0.0, 
    
    Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                   allowDefinition="Everywhere"
                   allowExeDefinition="MachineToApplication"/>
        </sectionGroup>
      </configSections>
    
      <system.web>
        <httpRuntime maxRequestLength="102400" />
        <compilation debug="true" />
      </system.web>
    
      <microsoft.Hpc.Session.ServiceRegistration>
        <!--Change assembly path below-->
        <service assembly="\\phmnt01\Services\HPCService.dll" bindingConfiguration="NetTcpBinding_IPricingService"
                 includeExceptionDetailInFaults="true" stdError="" soaDiagTraceLevel="Information, ActivityTracing">
        </service>
      </microsoft.Hpc.Session.ServiceRegistration>
    
      <system.serviceModel>
        <bindings>
          <netTcpBinding>
            <binding name="NetTcpBinding_IPricingService"
                      maxBufferSize="2147483647"
                      maxBufferPoolSize="524288"
                      maxReceivedMessageSize="2147483647">
              <readerQuotas maxDepth="64"
                            maxStringContentLength="131072"
                            maxArrayLength="16384"
                            maxBytesPerRead="16384"
                            maxNameTableCharCount="16384" />
            </binding>
            <!--binding used by broker's front end service with security-->
            <binding name="Microsoft.Hpc.SecureNetTcpBrokerBinding"
                     portSharingEnabled="true"
                     maxBufferPoolSize="102400"
                     maxBufferSize="102400"
                     maxReceivedMessageSize="102400">
              <security mode="Transport"/>
    
              <readerQuotas maxArrayLength="102400"
                         maxBytesPerRead="102400"
                         maxStringContentLength="102400"/>
    
            </binding>
            <!--binding used by broker's front end service with no security-->
            <binding name="Microsoft.Hpc.UnsecureNetTcpBrokerBinding"
                     portSharingEnabled="true"
                     maxBufferPoolSize="102400"
                     maxBufferSize="102400"
                     maxReceivedMessageSize="102400">
              <security mode="None"/>
              <readerQuotas maxArrayLength="102400"
                                    maxBytesPerRead="102400"
                                    maxStringContentLength="102400"/>
            </binding>
            <!--binding used by broker's backend-->
            <binding name="Microsoft.Hpc.BackEndBinding"
                     maxBufferPoolSize="102400"
                     maxBufferSize="102400"
                     maxReceivedMessageSize="102400">
              <security mode="Transport">
                <transport clientCredentialType="Windows" protectionLevel="None"/>
              </security>
              <readerQuotas maxArrayLength="102400"
                            maxBytesPerRead="102400"
                            maxStringContentLength="102400"/>
            </binding>
            </netTcpBinding>
            <basicHttpBinding>
              <!--binding used by broker's front end service with security-->
              <binding name="Microsoft.Hpc.SecureHttpBrokerBinding">
                <security mode="TransportWithMessageCredential">
                  <message clientCredentialType="UserName"/>
                  <transport clientCredentialType="None"/>
                </security>
              </binding>
              <!--binding used by broker's front end service with no security-->
              <binding name="Microsoft.Hpc.UnsecureHttpBrokerBinding">
                <security mode="None"/>
              </binding>
            </basicHttpBinding>
        </bindings>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="True" />
      </system.serviceModel>
    
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Information, ActivityTracing"
                  propagateActivity="true">
            <listeners>
              <add name="traceListener"
                  type="System.Diagnostics.XmlWriterTraceListener"
                  initializeData="\\phmnt01\TraceLogs\Traces.svclog" />
            </listeners>
          </source>
        </sources>
      </system.diagnostics>
    </configuration>

    the config on client-side :

    <?xml version="1.0"?>
    <configuration>
      <system.serviceModel>    
        <client>
          <endpoint address="http://localhost:8732/Woori/HPC/PricingService/"
            binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IPricingService"
            contract="ServiceReference1.IPricingService" name="WSHttpBinding_IPricingService">
            <identity>
              <userPrincipalName value="ysj@hpc.local" />
            </identity>
          </endpoint>
          <endpoint address="net.tcp://localhost:8733/Woori/HPC/PricingService"
            binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IPricingService"
            behaviorConfiguration="NetTcpEndPointBehavior" contract="ServiceReference1.IPricingService" 
            name="NetTcpBinding_IPricingService">
            <identity>
              <userPrincipalName value="ysj@hpc.local" />
            </identity>
          </endpoint>
        </client>
    
        <bindings>
          <netTcpBinding>
            <binding name="NetTcpBinding_IPricingService"
                     maxBufferSize="2147483647"
                     maxBufferPoolSize="524288"
                     maxReceivedMessageSize="2147483647">
              <readerQuotas maxDepth="32"
                            maxStringContentLength="8192"
                            maxArrayLength="16384"
                            maxBytesPerRead="4096"
                            maxNameTableCharCount="16384" />
            </binding>
          </netTcpBinding>
          <wsHttpBinding>
            <binding name="WSHttpBinding_IPricingService" />
          </wsHttpBinding>
        </bindings>
        <behaviors>
          <endpointBehaviors>
            <behavior name="NetTcpEndPointBehavior">
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </endpointBehaviors>
        </behaviors>
      </system.serviceModel>
    <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

    I already edited maxReceivedMessageSize property to maxium size. but still I see the exception.

    how to solve this?




    Monday, February 24, 2014 4:52 AM

Answers

  • Hi,

    First for your netTcpBinding, please try to increase the timeout value as well:

    <netTcpBinding> <binding name="NetTcpBinding_IPricingService" closeTimeout="00:20:00"
    openTimeout="00:20:00" receiveTimeout="0:20:00"
    sendTimeout="00:20:00" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> </binding>


    Then from you client side, I saw that you have used the wsHttpBinding, but in your service side, you did not have the wsHttpBinding, then it will cause the client and server mismatch. So please try to remove the wsHttpBinding, or change the wsHttpBinding as the basicHttpbinding.

    Then if you want to use the basichttpbinding, also please do not forget to increase the binding size as following:

    <bindings>
        <basicHttpBinding>
            <binding name="basicHttp" 
    closeTimeout="00:20:00"      
                     openTimeout="00:20:00"
                     receiveTimeout="0:20:00"

                     sendTimeout="00:20:00"
    allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000"> <readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000"/> </binding> </basicHttpBinding> </bindings>

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Tuesday, February 25, 2014 5:50 AM
    Moderator