2011-12-15 6 views
0

2つのエンドポイントbasicHttpBindingとpollingDuplexHttpBindingでWCFを使用しています。 Silverlight 4でWCFを消費しています。 私は単なる基本的なものを持っていて、ポーリングするとうまくいきます。しかし、1つのサービスと1つのSilverlightプロジェクトで両方を使用した場合、クライアントサイドでメッセージを受け取ることができます。サービス参照設定で認識できない要素 'pollingDuplexHttpBinding'

"サービス参照設定で認識できない要素 'pollingDuplexHttpBinding'があります。 "

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> 

そしてここでは、クライアント側でconfigです:あなたは、クライアントの設定に次のコードを追加する必要があります

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

答えて

0

はチェックアウトthis article

<!-- 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> 

+0

私は彼の設定ファイルは両側にあります。私はWCFとクライアントのすべての設定を書いていません。私は赤と唯一のデュプレックスポーリングの記事ですが、基本は動作しません。 – Musketyr

+0

basicはbasicHttpBindingを意味し、それには別のサービスが必要です。 Duplexesと基本サービスは互換性がないため、少なくとも2つのサービスが必要です。 – ViktorZ

関連する問題