2015-06-09 90 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打开此端口来解决此问题。