我在 IIS7 中托管了一个启用了 netTCP 的 WCF 服务。
这是我在 %apppath%\ 中的 web.config,SVC 文件所在的位置。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="Search.Querier.WCF.Querier" behaviorConfiguration="SearcherServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8050/SearcherService"/>
</baseAddresses>
</host>
<endpoint address="net.tcp://localhost:9000/SearcherService"
binding="netTcpBinding"
bindingConfiguration="Binding1"
contract="Search.Querier.WCF.IQuerier" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="Binding1"
hostNameComparisonMode="StrongWildcard"
sendTimeout="00:10:00"
maxReceivedMessageSize="65536"
transferMode="Buffered"
portSharingEnabled="false">
<security mode="None">
<transport clientCredentialType="None" />
<message clientCredentialType="None" />
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SearcherServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.web>
<compilation debug="true" />
</system.web>
</configuration>
出于某种原因,我没有按照我的说明在端口 8050 上加载,而是看到蓝色和米色的站点显示该站点:
http://localhost/SearcherService/searcherservice.svc 而不是 http://localhost:8050/SearcherService/searcherservice.svc
此外,当我尝试运行
svcutil.exe http://process.mycomp.com/SearcherService/SearcherService.svc?wsdl
正如 URL 上呈现的页面所说,我收到一个错误:
Metadata contains a reference that cannot be resolved: 'http://process.mycomp.com/SearcherService/SearcherService.svc?wsdl'
但是我在 web.config 中没有其他地方指定
还有其他地方可以吗?