我有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>
然後顯示您的wcf服務的配置 – BugFinder