locked
Silverlight 4 Polling Duplex - How to set the MaxReceivedMessageTimeout RRS feed

  • Question

  • I have a Silverlight 4 application that uses duplex polling to send information back to the client. I need to incease the default maxReceivedMessageSize of 65k to something a bit larger. I am confussed on how the config is layed out and if I need to create a customBinding element or not. Here is my config. Can someone show me where I set the max sizes and timeouts?

    Here is my config:

    <system.serviceModel>
    
        <extensions>
          <bindingExtensions>
            <add name="pollingDuplex" type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement,
                 System.ServiceModel.PollingDuplex,
                 Version=4.0.0.0,
                 Culture=neutral,
                 PublicKeyToken=31bf3856ad364e35" />
          </bindingExtensions>
        </extensions>
    
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true"  />
              
              <serviceThrottling maxConcurrentSessions="2147483647" maxConcurrentInstances="2147483647"   />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
    
        
        <bindings>
          <pollingDuplex>
            <binding name="myPollingDuplex" duplexMode="SingleMessagePerPoll" maxReceivedMessageSize="2000000" >
              <!--<security mode="Transport" />-->
              
            </binding>        
          </pollingDuplex>
        </bindings>
    
        <services>
          <service name="UnityEca.Web.Services.SearchPollingService">
            <endpoint address="" binding="pollingDuplex" bindingConfiguration="myPollingDuplex" contract="UnityEca.Web.Services.SearchPollingService"  />
            <!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />-->
          </service>
        </services>
    
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>


     

     

    Wednesday, February 9, 2011 8:23 PM

Answers

  • Hi CashCache, try to add this under your <bindings><pollingDuplex><binding name> section... and remove the maxReceivedMessageSize from the <binding name> tag

    <httpTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
                         maxBufferSize="2147483647" transferMode="StreamedResponse"  />


    use https if it's secured.  Mine is as this of course not using pollingDuplex

    <bindings>
        <customBinding>
            <binding name="CustomBinding_ReproService">
                <binaryMessageEncoding />
                <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
            </binding>
        </customBinding>
    </bindings>
    


     Here's someone else using tcpTransport with a lot of content you can dig on :
    http://tomasz.janczuk.org/2009_11_01_archive.html

     

    Thursday, February 10, 2011 6:21 AM