1

HTTPS を使用するように Silverlight アプリと双方向 WFC サービスを構成するにはどうすればよいですか? 現在、HTTP を使用するとすべてが機能しますが、クライアントが HTTPS を使用してサイトにアクセスするとすぐに、サービス内でのコールバックの作成が失敗します。構成ファイルを変更する必要があると思いますが、何に設定すればよいかわかりません。

これが私の現在の設定です:

<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" />

Silverlight アプリから、次のようにクライアント プロキシを作成します。

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

ありがとう...

4

1 に答える 1

0

SSL 用の clientaccesspolicy ファイルを実装しましたか? ここを参照してください: http://timheuer.com/blog/archive/2008/10/14/calling-secure-services-with-silverlight-2-ssl-https.aspx

ServicesReferences.clientconfig ファイルにセキュリティ要素を追加する必要がある場合もあります。

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

詳細については、この質問を参照してください。

于 2011-02-07T17:54:04.587 に答える