WCF服务netTCPbinding

前端之家收集整理的这篇文章主要介绍了WCF服务netTCPbinding前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想使用netTCPbinding,所以我改变了我的web配置,如下所示.我遇到了这个错误

Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].

怎么解决这个问题?








<services>
  <service name="DXDirectory.DXDirectoryService" behaviorConfiguration="DXDirectory.Service1Behavior">
    <!-- Service Endpoints -->
    <endpoint address="" binding="netTcpBinding" bindingConfiguration="WindowsSecured" contract="DXDirectory.IDXDirectoryService">
      <!-- 
          Upon deployment,the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed,WCF will infer an appropriate identity 
          automatically.
      -->
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:2582/DXDirectoryService" />
      </baseAddresses>
    </host>

  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="DXDirectory.Service1Behavior">
      <!-- To avoid disclosing Metadata information,set the value below to false and remove the Metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="false" />
      <!-- To receive exception details in faults for debugging purposes,set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false" />
      <serviceAuthorization principalPermissionMode="UseWindowsGroups" />
      <!--<serviceCredentials>-->
        <!--<userNameAuthentication userNamePasswordValidationMode="Custom"
                                membershipProviderName="CustomUserNameValidator"/>-->
      <!--</serviceCredentials>-->
    </behavior>
  </serviceBehaviors>
</behaviors>

解决方法

HMm …你已经将基地址添加到你的服务/主机部分了.

快速提问:你是自托管,还是在IIS托管?哪个版本的IIS?

IIS5 / 6仅支持HTTP连接 – 您无法在IIS 5/6中托管NetTCP.

在IIS7中,您必须手动执行一系列步骤以启用非HTTP绑定,但这是可能的.有关如何实现此目的,请参阅this MSDN article.

自托管是最佳选择 – 您可以获得所有绑定,并完全控制您托管的服务.

猜你在找的HTML相关文章