服务参考配置中无法识别的元素'pollingDuplexHttpBinding'

服务参考配置中无法识别的元素'pollingDuplexHttpBinding'

问题描述:

我使用带有两个端点basicHttpBinding和pollingDuplexHttpBinding的WCF。 在Silverlight 4中消费WCF。 如果我有单独的基本..和投票..它的效果很好。但是,如果我在一个服务和一个silverlight项目中使用了这两个项目,我在客户端获得了以下消息:服务参考配置中无法识别的元素'pollingDuplexHttpBinding'

“服务参考配置中无法识别的元素”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" /> 

退房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

我有t他在配置文件的两边。我不写所有配置的WCF和客户端。文章我红色和独自双工轮询工作,但与基本不工作。 – Musketyr 2011-12-15 09:03:04