views:

22

answers:

0

I am trying to setup a Silverlight 3 application to use a WCF web service through the PollingDuplexHttpBinding. I have this working over basic HTTP, but I need to get it to work over HTTP*S*.

Server web.config:

<system.serviceModel>
    <extensions>
        <bindingExtensions>
            <add name="pollingDuplexHttpBinding" 
                type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement, System.ServiceModel.PollingDuplex, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </bindingExtensions>
    </extensions>
    <behaviors>
        <serviceBehaviors>
            <behavior name="DuplexServiceBehavior">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <bindings>
        <pollingDuplexHttpBinding>
    <binding name="PollingDuplexHttpBinding" sendTimeout="00:00:05">
      <security mode="Transport"/>
    </binding>
        </pollingDuplexHttpBinding>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    <services>
        <service behaviorConfiguration="DuplexServiceBehavior" name="Client.Web.DuplexTest">
            <endpoint address="" binding="pollingDuplexHttpBinding" contract="Client.Web.IDuplexTest"/>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        </service>
    </services>
</system.serviceModel>

Client Code:

EndpointAddress address = new EndpointAddress( "**https**://" + App.Current.Host.Source.Host
    + ":" + App.Current.Host.Source.Port + "/DuplexTest.svc");
service = new DuplexTest.DuplexTestClient(new PollingDuplexHttpBinding(PollingDuplexHttpSecurityMode.Transport) { SendTimeout = new TimeSpan(0, 0, 5) }, address);

If I set it to use "http" in the client code, and take out the tag in the web.config, it works fine. If I try to run this, I get a TimeoutException.

Any help on configuring this is appreciated.