简体   繁体   English

WCF服务仅侦听localhost(127.0.0.1)

[英]WCF service listens only localhost (127.0.0.1)

I have WCF service which works as windows service. 我有WCF服务,可以用作Windows服务。 Service works fine, tested with 100+ clients. 服务运作良好,并与100多个客户进行了测试。 But one machine works only on localhost. 但是一台机器只能在本地主机上运行。 Service is hosted on windows server 2012 r2. 服务托管在Windows Server 2012 R2上。 Adding image of 'netstat'. 正在添加“ netstat”的图片。 On similar working server, service is listening on '0.0.0.0:88'. 在类似的工作服务器上,服务正在侦听“ 0.0.0.0:88”。

Tried various endpoints '0.0.0.0:88/MyService.svc', '198.xxx:88/MyService.svc', 'HostName:88/MyService.svc' all work localy only. 尝试了各种端点'0.0.0.0:88/MyService.svc'、'198.xxx:88/MyService.svc'、'HostName:88/MyService.svc'仅在本地工作。

Service config: 服务配置:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="connectionString" value="xxxxx"/>
  </appSettings>
  <connectionStrings>    
  </connectionStrings>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="BehaviourService">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="FvsBasicHttp" receiveTimeout="00:20:00" sendTimeout="00:20:00" openTimeout="00:20:00" closeTimeout="00:20:00"
                 maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="32" maxBytesPerRead="2147483647"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="FvsWebServiceWcf.FvsService" behaviorConfiguration="BehaviourService" >
        <endpoint name="FvsService" address ="" binding="basicHttpBinding" bindingConfiguration="FvsBasicHttp" contract="FvsWebServiceWcf.IFvsService"></endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="http://195.x.x.x:88/MyService.asmx"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
</configuration>

Possible guess: Someone messed the machine up by setting HTTP.SYS to only listen on the localhost interface. 可能的猜测:有人通过将HTTP.SYS设置为仅在localhost接口上进行侦听来弄乱了计算机。 You could check this by running the command: 您可以通过运行以下命令进行检查:

netsh.exe http show iplisten

If it does return 127.0.0.1 as expected, you probably need to remove the entry with ( netsh.exe http delete iplisten ipaddress=127.0.0.1 ). 如果确实按预期返回了127.0.0.1,则可能需要使用( netsh.exe http delete iplisten ipaddress=127.0.0.1netsh.exe http delete iplisten ipaddress=127.0.0.1条目。 Not sure if you'd need to add 0.0.0.0 again just to get it to work again. 不知道是否需要再次添加0.0.0.0才能使其再次正常工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 构建侦听入站事件的WCF Web服务 - Build WCF web service that listens for inbound events 添加服务参考仅适用于localhost wcf服务 - add service reference only works with localhost wcf service WCF服务仅在json响应的情况下才将localhost转换为www.localhost.com - WCF Service converts localhost to www.localhost.com only in case of json response 无法在本地主机中运行 wcf 服务 - Unable to run wcf service in localhost 连续调用WCF服务将返回“通常只允许使用每个套接字地址(协议/网络地址/端口)127.0.0.1:10111” - Continuous calls to WCF service returns “Only one usage of each socket address (protocol/network address/port) is normally permitted 127.0.0.1:10111” WCF URI仅适用于本地主机 - WCF URI only works on localhost 自定义http服务可以很好地响应本地IP地址,但不能响应localhost或127.0.0.1 - Custom http service responds fine to local IP address but NOT to localhost or 127.0.0.1 如何禁用WCF自托管localhost仅限PC的防火墙端口例外窗口的服务升级? - How to disable WCF self-hosted localhost pc only service promotion of firewall port exception window? 仅从本地计算机成功连接我的WCF服务,除非指定了计算机IP地址而不是本地主机 - Succeed to connect my WCF service only from local machine unless machine ip address is specified instead of localhost 将 WCF 服务访问限制为仅使用控制台应用程序托管的本地主机 - Restricting WCF Service access to only localhost which is hosted using console application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM