【发布时间】:2015-11-23 10:04:33
【问题描述】:
我正在尝试创建托管在 IIS 7 中的双工 WCF 服务。
我已经在 IIS 中设置了服务,当在浏览器中导航到该页面时,我可以看到 WSDL 信息。
当我从我的应用程序运行它时,我得到:
您尝试为不支持 .Net 框架的服务创建通道。您可能遇到了 HTTP 端点。
在 IIS 中我做了以下操作:
- 应用程序池:ASP.NET 4.0 绑定:
- http::8026:,net.tcp:8026: 已启用
- 协议: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