【问题标题】:WCF port issue and proxy creationWCF 端口问题和代理创建
【发布时间】:2012-12-30 15:09:53
【问题描述】:

我开发了一个小型 wcf 服务。它托管在 Windows 窗体应用程序中并启动服务,它在端口 1645 上运行。这是我的服务的 app.config 条目。

我的服务已启动,当我尝试创建代理放置 url 像 net.tcp://localhost:1645/ChatServer/mex 然后我看到 VS IDE 无法找到该服务但我的服务在同一台电脑上运行。经过大量尝试,当我将端口从 1645 更改为 7999 时,我看到代理已创建。所以我很困惑,当端口是 1645 时,服务是不可发现的,而当我更改端口时,它就开始工作了。如果有与端口相关的问题,那么如何在 1645 端口启动服务?我只是无法弄清楚实际问题是什么。所以任何人以前遇到过这种问题然后指导我1645的端口相关问题是什么。

谁能告诉我 1645 端口有什么问题,结果我一再无法创建代理。有什么工具可以帮助我诊断端口 1645 的端口相关问题吗?谢谢

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="WCFService.Service" behaviorConfiguration="behaviorConfig">

<host>
  <baseAddresses>
    <add baseAddress="net.tcp://localhost:1645/ChatServer/"/>
    <add baseAddress="http://localhost:1648/ChatServer/"/>
  </baseAddresses>
  </host>
  <endpoint address="tcp"
                  binding="netTcpBinding"
                  bindingConfiguration="tcpBinding"
                  contract="ChatService.IChat"/>

 <endpoint address="net.tcp://localhost:1645/ChatServer/mex"
                  binding="mexTcpBinding"
                  contract="IMetadataExchange"/>

 </service>
 </services>

 <behaviors>
 <serviceBehaviors>
 <behavior name="behaviorConfig">
  <serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
  <serviceDebug includeExceptionDetailInFaults="true"/>
  <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100"/>
 </behavior>
 </serviceBehaviors>
 </behaviors>
 <bindings>
 <netTcpBinding>
 <binding name="tcpBinding"
                 maxBufferSize="67108864"
                 maxReceivedMessageSize="67108864"
                 maxBufferPoolSize="67108864"
                 transferMode="Buffered"
                 closeTimeout="00:00:10"
                 openTimeout="00:00:10"
                 receiveTimeout="00:20:00"
                 sendTimeout="00:01:00"
                 maxConnections="100">
  <security mode="None">
  </security>
  <readerQuotas maxArrayLength="67108864"
                          maxBytesPerRead="67108864"
                          maxStringContentLength="67108864"/>
  <reliableSession enabled="true" inactivityTimeout="00:20:00"/>
  </binding>
  </netTcpBinding>
  </bindings>
  </system.serviceModel>
  </configuration>

【问题讨论】:

    标签: wcf


    【解决方案1】:

    我不完全确定您的问题是什么,但我用来调查的第一个工具是 TCPView: http://technet.microsoft.com/en-ca/sysinternals/bb897437.aspx 这样您就可以查看是否有任何进程正在侦听该端口。

    另外,如果您使用的是 Windows 2008 或 2012,它可能与 radius 服务有关: http://technet.microsoft.com/en-us/library/cc731277.aspx

    【讨论】:

      猜你喜欢
      • 2011-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多