【问题标题】:WCF service hosted in IIS with netTCP binding使用 netTCP 绑定托管在 IIS 中的 WCF 服务
【发布时间】:2009-09-23 20:34:27
【问题描述】:

我有一个托管在 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 中没有其他地方指定

还有其他地方可以吗?

【问题讨论】:

    标签: wcf wcf-binding wcf-client


    【解决方案1】:
    猜你喜欢
    • 2016-10-11
    • 2015-01-28
    • 1970-01-01
    • 1970-01-01
    • 2022-12-13
    • 1970-01-01
    • 2011-10-24
    • 1970-01-01
    • 2012-04-02
    相关资源
    最近更新 更多