【问题标题】:WCF Duplex Service - .Net Framing ErrorWCF 双工服务 - .Net 帧错误
【发布时间】:2015-11-23 10:04:33
【问题描述】:

我正在尝试创建托管在 IIS 7 中的双工 WCF 服务。

我已经在 IIS 中设置了服务,当在浏览器中导航到该页面时,我可以看到 WSDL 信息。

当我从我的应用程序运行它时,我得到:

您尝试为不支持 .Net 框架的服务创建通道。您可能遇到了 HTTP 端点。

在 IIS 中我做了以下操作:

  1. 应用程序池:ASP.NET 4.0 绑定:
  2. http::8026:,net.tcp:8026: 已启用
  3. 协议:http,net.tcp

这是 Web.Config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>

    <system.web>
    <compilation debug="true" />
  </system.web>

  <system.serviceModel>
    <services>

      <service name="InfoGov.Service.InfoGovService">
        <endpoint binding="netTcpBinding" 
                  contract="InfoGov.Service.IInfoGovService">
        </endpoint>
        <endpoint address="mex" 
                  binding="mexTcpBinding" 
                  contract="IMetadataExchange" />
      </service>

    </services>

      <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="True" 
                           httpsGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

</system.serviceModel>
</configuration>

这是客户端配置:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
    </configSections>
    <startup> 
        <supportedRuntime version="v4.0" 
                          sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>

      <bindings>
        <netTcpBinding>
          <binding name="NetTcpBinding_IInfoGovService" />
        </netTcpBinding>
      </bindings>

      <client>
        <endpoint address="net.tcp://localhost:8026/Service.svc" 
                  binding="netTcpBinding"
                  bindingConfiguration="NetTcpBinding_IInfoGovService" 
                  contract="InfoGovProxy.IInfoGovService"
                  name="NetTcpBinding_IInfoGovService">
          <identity>
            <servicePrincipalName value="host/localhost" />
          </identity>
        </endpoint>
      </client>

    </system.serviceModel>
</configuration>

我已经用谷歌搜索了这条错误消息。没有太多关于它的内容,我查看或尝试了一些结果,但没有成功。

谁能看出这里出了什么问题?

谢谢

【问题讨论】:

    标签: wcf


    【解决方案1】:

    http::8026:,net.tcp:8026: 启用

    有相同问题的讨论。 https://social.msdn.microsoft.com/Forums/vstudio/en-US/c657ba19-5a0f-4cd6-962b-bfee69bdffad/does-not-support-net-framing?forum=wcf

    对于解决方案,请尝试为 http 和 net.tcp 协议设置不同的端口

    【讨论】:

    • 谢谢。我已经看过那个帖子了。我已经检查了端口。没关系。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-23
    • 1970-01-01
    • 1970-01-01
    • 2010-10-26
    相关资源
    最近更新 更多