首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >服务引用配置中无法识别的元素'pollingDuplexHttpBinding‘

服务引用配置中无法识别的元素'pollingDuplexHttpBinding‘
EN

Stack Overflow用户
提问于 2011-12-15 14:54:53
回答 1查看 1.5K关注 0票数 0

我正在使用WCF和两个端点basicHttpBinding和pollingDuplexHttpBinding。在Silverlight中使用WCF 4.如果我只有basic..和轮询..它运行良好。但是如果我在一个服务和一个silverlight项目中同时使用,我会收到客户端的消息:

“服务引用配置中无法识别的元素'pollingDuplexHttpBinding‘。请注意,Silverlight中仅提供Windows Communication Foundation配置功能的子集。”

WFC被正确引用到silverlight项目,但不起作用。以下是WCF的web.config:

代码语言:javascript
复制
 <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>

下面是客户端的配置:

代码语言:javascript
复制
<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" />
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-12-15 16:03:33

查看this article

您需要在客户端配置中添加以下代码片段:

代码语言:javascript
复制
<!-- 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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8516184

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档