Ray Saltrelli

Ray Saltrelli RaySaltrelli

Niner since 2011

Software engineer at Mapping Analyitics in Rochester, NY.

Comments

  • Duplex ​Communicati​on with WCF in Silverlight 4 (Silverlight TV #34)

    Hi Tomasz,

    I'm trying to write a subscription service similar to this chat service.  Below is my web.config:

    <?xml version="1.0"?>
    <configuration>

    <system.web>
    <compilation debug="true" targetFramework="4.0" />
    </system.web>
    <system.serviceModel>
    <extensions>
    <bindingElementExtensions>
    <add name="pollingDuplex" type="System.ServiceModel.Configuration.PollingDuplexHttpBindingElement, System.ServiceModel.PollingDuplex, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </bindingElementExtensions>
    </extensions>
    <bindings>
    <customBinding>
    <binding name="MAD.ChangeNotificationServices.SubscriptionService.customBinding0">
    <binaryMessageEncoding />
    <pollingDuplex duplexMode="MultipleMessagesPerPoll"></pollingDuplex>
    <httpTransport />
    </binding>
    </customBinding>
    </bindings>
    <services>
    <service name="MAD.ChangeNotificationServices.SubscriptionService">
    <endpoint address="" binding="customBinding" bindingConfiguration="MAD.ChangeNotificationServices.SubscriptionService.customBinding0"
    contract="MAD.ChangeNotificationServices.ISubscriptionService" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
    </services>
    <behaviors>
    <serviceBehaviors>
    <behavior>
    <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
    <serviceMetadata httpGetEnabled="true"/>
    <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
    <serviceDebug includeExceptionDetailInFaults="false"/>
    <serviceThrottling maxConcurrentSessions="2147483647"/>
    </behavior>
    </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
    multipleSiteBindingsEnabled="true" />
    </system.serviceModel>
    <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    </system.webServer>

    </configuration>

    When I use SingleMessagePerPoll as my duplex mode, everything works fine.  But when I switch to MultipleMessagesPerPoll, calls to the subscription service result in an operation timeout after 1 minute.  If I place a break point in the method I am calling in the subscription service, the break point is never hit.  Do you have any wisdom to share?