2011-05-10 109 views
0

我在雙工協議上做了一個WCF服務。 它工作正常,沒問題。但我只有一個小問題:WCF通過IIS問題IP地址

這裏是我在哪裏可以啓動它的測試IP字符串: http://localhost:5659/Service.svc

但是,當我選擇我的本地計算機上我的真實IP地址(其中,本地存在): http://93.4.18.3:5659/Service.svc

我還不能確定。另外我無法使用我的真實IP地址從其他地​​址連接。 可能是我的web.config中出現錯誤?

順便說一句 - 我的防火牆,如果關閉。

這裏是我的配置:

<extensions> 
    <bindingElementExtensions> 
    <add name="pollingDuplex" type="System.ServiceModel.Configuration.PollingDuplexElement, System.ServiceModel.PollingDuplex" /> 
    </bindingElementExtensions> 
</extensions> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="GameStreamServiceBehavior"> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     <serviceThrottling maxConcurrentSessions="2147483647" /> 
     <serviceMetadata httpGetEnabled="true" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<bindings> 
    <customBinding> 
    <binding name="pollingDuplexBinding"> 
     <binaryMessageEncoding /> 
     <pollingDuplex maxPendingSessions="2147483647" maxPendingMessagesPerSession="2147483647" inactivityTimeout="02:00:00" serverPollTimeout="00:05:00" /> 
     <httpTransport /> 
    </binding> 
    </customBinding> 
</bindings> 
<services> 
    <service name="WcfServer.Service" behaviorConfiguration="GameStreamServiceBehavior"> 
    <endpoint address="" binding="customBinding" bindingConfiguration="pollingDuplexBinding" contract="WcfServer.IService" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
</services> 

+0

如何在IIS中配置該站點的HTTP綁定? – mthierba 2011-05-10 19:50:44

+0

這是所有帶有配置的文件。我應該在哪裏找到HTTP綁定? – alerya 2011-05-10 20:40:48

+1

在IIS管理器中:右鍵單擊託管此服務的站點,選擇「編輯綁定...」,然後查看它對HTTP的說明,尤其是「IP地址」列。 – mthierba 2011-05-10 21:42:14

回答

1

您應該檢查IIS中的站點綁定。端口5659上的HTTP綁定可能僅針對特定主機頭(「localhost」)或特定IP地址(而非93.4.18.3)進行配置。這將解釋你得到的行爲。