[英]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.1
) netsh.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.