2017-08-04 51 views
0

我有WCF服務,它作爲Windows服務。服務工作正常,與100多個客戶進行了測試。但是一臺機器只能在本地主機上運行。服務託管在Windows Server 2012 R2上。添加'netstat'的圖像。在類似的工作服務器上,服務正在偵聽'0.0.0.0:88'。WCF服務只偵聽本地主機(127.0.0.1)

嘗試了各種端點的0.0.0.0:88/MyService.svc', '198.x.x.x:88/MyService.svc', '主機名:88/MyService.svc' 一切工作只localy。

服務配置:

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

然後顯示您的wcf服務的配置 – BugFinder

回答

1

可能的猜測:有人通過設置HTTP.SYS只localhost接口上聽亂七八糟的機器了。你可以通過運行以下命令檢查:

netsh.exe http show iplisten

如果確實如預期回報127.0.0.1,你可能需要刪除與(netsh.exe http delete iplisten ipaddress=127.0.0.1)的條目。不確定是否需要再次添加0.0.0.0才能使其再次運行。

+1

tomasr非常感謝,保存了我的一天。命令:「netsh http add iplisten ipaddress = 0.0.0.0」和「netsh http delete iplisten ipaddress = 127.0.0.1」 – Ramunas