2009-08-31 103 views
8

我想使用netTCPbinding,所以我改变了我的web配置如下。我遇到这个错误:WCF服务netTCPbinding

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> 
+0

想知道在WCF更多关于NetTcpBinding的... 访问这个链接它有很多的信息.​​. http://www.planetofcoders.com/nettcpbinding-in-wcf/ – 2013-08-14 13:09:26

回答

5

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

快速问题:你是自承载还是托管在IIS?哪个版本的IIS?

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

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

自托管是最好的选择 - 您可以获得所有绑定并完全控制托管的服务。

马克

+0

我使用自托管和IIS 7 – 2009-08-31 11:03:47

+0

所以rry Marc,我正在使用IIS 5.1 – 2009-08-31 11:29:22

+0

正如我所提到的 - IIS5不会与NetTCP绑定一起工作 - 在这种情况下您需要使用自托管。你在自我托管中也有同样的错误吗? – 2009-08-31 12:51:51

4

这里是从MSDN一个NetTcpBinding基本示例。看看这可以帮助你。

编辑:

而且here是相关的SO问题。

0

我不能见你的配置文件,可以ü请 请添加此

<netTcpBinding> 

<binding name="WindowsSecured"> 
<security mode="none"/> 
</binding> 

</netTcpBinding> 

相关问题