1

How do I configure my Silverlight app and duplex WFC service to use HTTPS? Currently evrything works if using HTTP, but as soon as the client hits the site using HTTPS, the callback creation within the service fails. I believe I need to modify my config file, but I can't figure out what it should be set to.

Here is my current 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" />        
  </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" />

From my Silverlight app, I create the client proxy like so:

SearchPollingServiceClient client = new SearchPollingProxy.SearchPollingServiceClient(
    new PollingDuplexHttpBinding { DuplexMode = PollingDuplexMode.SingleMessagePerPoll },
    new EndpointAddress("../Services/SearchPollingService.svc"));

Thanks...

Scott
  • 874
  • 3
  • 12
  • 36

1 Answers1

0

Have you implemented a clientaccesspolicy file for SSL? See here: http://timheuer.com/blog/archive/2008/10/14/calling-secure-services-with-silverlight-2-ssl-https.aspx

You may also need to add a security element to your ServicesReferences.clientconfig file:

<bindings>
  <pollingDuplex>
    <binding name="myPollingDuplex" duplexMode="SingleMessagePerPoll">
        <security mode="Transport" />
    </binding>
  </pollingDuplex>
</bindings>

See this question for more details.

Community
  • 1
  • 1
Ken Smith
  • 20,305
  • 15
  • 100
  • 147
  • The xap and the service are in the same domain and I am wanting to use HTTPS across them both. That clientaccesspolicy file would be used if I want to cross protolols or domains. I don't think that will help me in this case. Am I wrong? – Scott Feb 07 '11 at 18:01
  • In theory, that should work, though I'd try adding it just to be sure. You should also add the element that I mention above in my newly edited answer :-). – Ken Smith Feb 07 '11 at 18:45
  • Thanks, but I've tried that one a dozen times. I'm gonig to add the clientaccesspolicy file just to rule it out. – Scott Feb 07 '11 at 18:50