2015-06-09 340 views
1

我與WCF在IIS上工作7IIS 7 ERR_CONNECTION_TIMED_OUT只有公網IP

此之前,我已經做了WCF庫,並將其設置在IIS 7的工作它運作良好,另外,如果我用它與我們的公共IP。

然後,我做了一個WCF應用程序,並將其設置爲在同一個IIS 7上工作。地址是相同的,不同之處在於端口。當我使用內部IP調用它時,此WCF正常工作,但是我使用外部IP,但出現超時錯誤。

你可以嘗試自己,這是pubblic地址:

http://77.108.40.77:8096/

(如果你把8095作爲端口,它的工作原理)。

爲什麼我得到這個? (ERR_CONNECTION_TIMED_OUT)

這是我的web.config:

<?xml version="1.0" encoding="utf-8"?> 
    <configuration> 

     <configSections> 
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.``0, Culture=neutral, ``PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
    </configSections> 
    <system.web> 
    <compilation debug="true" targetFramework="4.5" /> 
    <httpRuntime targetFramework="4.5" /> 
    </system.web> 
    <system.serviceModel> 
    <services> 
    <service name="MultipayOnline.Service1" > 
    <!--bindingConfiguration="SecurityByTransport"--> 
    <!--<endpoint address="" binding="basicHttpBinding" bindingConfiguration="SecurityByTransport" name="base" contract="CardServiceLib.ICardService">--> 

     <endpoint address="" name="base" 
       behaviorConfiguration="restBehavior" 
       binding="webHttpBinding" 
       contract="MultipayOnline.IMultiPOService" > 
     <identity> 
     <dns value="localhost"/> 
     </identity> 
    </endpoint> 
    </service> 
</services> 
<bindings> 
    <webHttpBinding> 
    <binding name="SecurityByTransport" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" > 
     <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
     <security mode="TransportCredentialOnly"> 
     <transport clientCredentialType="Basic"/> 
     </security> 
    </binding> 
    </webHttpBinding> 
</bindings> 


<extensions> 
    <behaviorExtensions> 
    <add name="CorsSupport" type="WebHttpCors.CorsSupportBehaviorElement, WebHttpCors, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> 
    </behaviorExtensions> 
</extensions> 


<behaviors> 
    <endpointBehaviors> 
    <behavior name="restBehavior"> 
     <!--<enableWebScript/>--> 
     <webHttp helpEnabled="true"/> 
     <CorsSupport /> 
    </behavior> 
    </endpointBehaviors> 
    <serviceBehaviors> 
    <behavior> 
     <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     <dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="123456" /> 
    </behavior> 
    <!--<behavior name="customBehavior"> 
     <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/> 
     <serviceDebug includeExceptionDetailInFaults="True"/> 
     <dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="123456" /> 
     <serviceCredentials> 
     <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="MultipayOnline.CustomPass, MultipayOnline"/> 
     </serviceCredentials> 
    </behavior>--> 
    </serviceBehaviors> 
</behaviors> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 


<protocolMapping> 
    <add binding="basicHttpsBinding" scheme="https" /> 
</protocolMapping> 
    </system.serviceModel> 
    <system.webServer> 
<modules runAllManagedModulesForAllRequests="true" /> 
<!-- 
    Per sfogliare la directory radice dell'applicazione Web durante il debug, impostare il valore riportato sotto su true. 
    Impostarlo su false prima della distribuzione per evitare di diffondere informazioni sulla cartella dell'applicazione Web. 
    --> 
<directoryBrowse enabled="true" /> 
<!--<httpProtocol> 
    <customHeaders> 
    <add name="Access-Control-Allow-Origin" value="*" /> 
    </customHeaders> 
</httpProtocol>--> 
    </system.webServer> 


    <connectionStrings><add name="isMultiPayOnLineEntities" connectionString="..." providerName="System.Data.EntityClient" /> </connectionStrings> 

你能幫助我嗎?我可以張貼一些東西給你,使問題更清楚嗎?

+0

該端口是否在防火牆上打開/轉發至路由器上的本地計算機? – TZHX

+0

你的意思是在iis服務器的防火牆中? –

+0

好吧,任何防火牆,你真的在​​互聯網和那臺機器之間。另外:可能是本地環回被禁止在您的路由器上,所以您將無法使用公共IP從網絡內部引用本機。 – TZHX

回答

0

我認爲你的端口已關閉。如果狀態爲關閉,請檢查你的IP和端口http://ping.eu/port-chk/,然後顯示此信息。 Plz打開此端口來解決此問題。