0

私は、basicHttpBinding と pollingDuplexHttpBinding の 2 つのエンドポイントで WCF を使用しています。Silverlight 4 で WCF を使用しています。basic.. と polling.. だけがあれば、うまくいきます。しかし、1 つのサービスと 1 つの Silverlight プロジェクトで両方を使用すると、クライアント側で次のメッセージが表示されました。

「サービス参照構成の要素 'pollingDuplexHttpBinding' を認識できません。Silverlight では、Windows Communication Foundation 構成機能のサブセットのみを使用できることに注意してください。」

WFC は Silverlight プロジェクトを正しく参照していますが、機能していません。WCF の web.config は次のとおりです。

 <services>
      <service behaviorConfiguration="Service1Behavior" name="Service1">
        <endpoint
          address=""
          binding="basicHttpBinding"
          bindingConfiguration="LargeBuffer"
          contract="IService1"
          listenUri="http://localhost:7007/Service1.svc">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint
          address=""
          binding="pollingDuplexHttpBinding"
          bindingConfiguration="multipleMessagesPerPollPollingDuplexHttpBinding"
          contract="ILongService1"
          listenUri="http://localhost:7007/Service1.svc/LongService">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>

        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>

クライアント側の設定は次のとおりです。

<endpoint address="http://localhost:7007/ServiceWebTDM.svc/LongService"
      binding="pollingDuplexHttpBinding" bindingConfiguration="multipleMessagesPerPollPollingDuplexHttpBinding"
      contract="GXWebTDM.Web.ILongServiceWebTDM" name="LongServiceWebTDMDev" />

          <endpoint address="http://localhost:7007/ServiceWebTDM.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IServiceWebTDM1" contract="GXWebTDMService.IServiceWebTDM"
                name="ServiceWebTDMDev" />
4

1 に答える 1

0

この記事を確認してください
。クライアント構成に次のスニペットを追加する必要があります。

<!-- Register the binding extension from the SDK. -->
<extensions>
  <bindingExtensions>
    <add name=
        "pollingDuplexHttpBinding"
        type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement,System.ServiceModel.PollingDuplex, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </bindingExtensions>

于 2011-12-15T08:03:33.223 に答える