首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WCF服务netTCPbinding

WCF服务netTCPbinding
EN

Stack Overflow用户
提问于 2009-08-31 09:58:10
回答 2查看 30.8K关注 0票数 8

我想使用netTCPbinding,所以我已经更改了我的web配置如下。我正在经历这样的错误:

找不到与绑定net.tcp的端点的方案NetTcpBinding匹配的基址。注册的基本地址计划是http。

如何解决这一问题?

代码语言:javascript
复制
<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>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2009-08-31 10:35:24

HMm...您已经将基本地址添加到服务/主机部分ok。

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

IIS 5/6只支持HTTP连接--您不能在IIS 5/6中承载NetTCP。

在IIS7中,您必须手动执行一系列步骤来启用非HTTP绑定,但这是可能的。关于如何实现这一点,请参见这篇MSDN文章

自我托管是最好的选择-你得到所有的绑定,并完全控制您的服务被托管。

Marc

票数 5
EN

Stack Overflow用户

发布于 2009-08-31 10:11:23

下面是msdn的一个NetTcpBinding基本示例。看看能不能帮上忙。

编辑:

这里是一个与此相关的问题。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1356739

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档