【问题标题】:What is the right way to configure netTcpBinding in WCF 4.X在 WCF 4.X 中配置 netTcpBinding 的正确方法是什么
【发布时间】:2016-05-07 22:43:51
【问题描述】:

我正在开发一个 WCF 应用程序,其绑定必须是“netTcpBinding”,但是当我在 Visual Studio 2013 中运行它时,我收到此错误“无法获取元数据 http://localhost:62081 / Queue.svc”。我像以前一样进行了激烈的搜索,但没有找到工作的例子。我想了解这是如何工作的。谢谢!!!您将在下面找到我的网络配置:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <appSettings>
   <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
 </appSettings>
 <system.web>
   <compilation debug="true" targetFramework="4.5" />
 </system.web>
 <system.serviceModel>
   <behaviors>
     <serviceBehaviors>
       <behavior name="QueueBehavior">
         <serviceDebug includeExceptionDetailInFaults="true" />
         <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
    </behavior>
     </serviceBehaviors>
   </behaviors>
   <services>
     <service behaviorConfiguration="QueueBehavior" name="ComponenteCola.Queue">
       <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
      name="QueueNetTcpEndPoint" contract="ComponenteCola.IQueue" />
       <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
      name="NetTcpMetadataPoint" contract="IMetadataExchange" />
       <host>
         <baseAddresses>
           <add baseAddress="net.tcp://localhost:57965/Queue" />
         </baseAddresses>
       </host>
     </service>
   </services>
 </system.serviceModel>
</configuration>

【问题讨论】:

    标签: c# wcf visual-studio-2013 wcf-binding nettcpbinding


    【解决方案1】:

    希望仍然有帮助

    我认为它需要实际的元数据 URL,尝试像这样添加

    <baseAddresses>
           <add baseAddress="net.tcp://localhost:57965/Queue" />
           <add baseAddress="http://localhost:62081/Queue/mex" />
    </baseAddresses>
    

    我正在使用带有 .NET 4 的自托管 WCF 服务,但我认为不会有这么多差异。

    HTH

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-06
      • 2012-08-22
      • 2015-02-11
      • 2010-11-24
      • 2010-10-21
      • 1970-01-01
      • 2012-03-18
      • 2011-06-15
      相关资源
      最近更新 更多