2012-01-31 17 views
0

我在遠程計算機上的iis上託管了一個wcf服務,並試圖從另一臺計算機訪問該服務。兩臺機器位於同一個域中。客戶端的app.config:打開操作未在指定時間內完成wcf wsdualhttpbinding

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.serviceModel> 
     <bindings> 
      <wsDualHttpBinding> 
       <binding name="WSDualHttpBinding_IReportReceiver" closeTimeout="00:01:00" 
        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
        bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
        maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
        messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true"> 
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
         maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
        <reliableSession ordered="true" inactivityTimeout="00:10:00" /> 
        <security mode="None"> 
         <message clientCredentialType="Windows" negotiateServiceCredential="true" 
          algorithmSuite="Default" /> 
        </security> 
       </binding> 
      </wsDualHttpBinding> 
     </bindings> 
     <client> 
      <endpoint address="http://nts0104:5950/ReportReceiver.svc" 
       binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IReportReceiver" 
       contract="ServiceReference1.IReportReceiver" name="WSDualHttpBinding_IReportReceiver"> 
       <identity> 
        <userPrincipalName value="ReportServer\[email protected]" /> 
       </identity> 
      </endpoint> 
     </client> 


    </system.serviceModel> 
    <system.diagnostics> 
    <sources> 
     <source name="System.ServiceModel" 
       switchValue="Error" 
       propagateActivity="true"> 
     <listeners> 
      <add name="traceListener" 
       type="System.Diagnostics.XmlWriterTraceListener" 
       initializeData= "c:\log\Traces.svclog" /> 
     </listeners> 
     </source> 
    </sources> 
    </system.diagnostics> 
    </configuration> 

該服務在特定池和帳戶[email protected]下運行。 沒有線索的這種情況發生.surfed很多,沒有幫助.pls提供你的解決方案。 謝謝

回答

1

這很可能是防火牆問題,因爲wsDualHttpBinding嘗試打開從服務器到客戶端的連接(以支持回調)。在最健壯的網絡環境中,這很可能會失敗。

我的建議是使用NetTcpBinding的,而不是因爲它發出回調下來相同的連接,客戶端打開到服務器

我的博客上講述這個here

+0

我想使用wsdualhttpbinding。所以任何其他的解決方案請 – sow 2012-01-31 08:35:23

+0

,因爲這兩臺機器都在同一個域中,我覺得這可能不是防火牆問題 – sow 2012-01-31 09:18:04

+0

請記住,Windows有一個內置的防火牆,默認情況下會阻止傳入的連接。此外,在域網絡設置中也可能有防火牆。出於興趣,你爲什麼如此想使用wsDualHttpBinding?它比NetTcpBinding更慢,更不可靠 – 2012-01-31 09:21:16

0

終於得到了它wsDualHttpBinding工作。 在客戶端的app.config中,在綁定元素下添加了屬性useDefaultWebProxy =「true」。

<wsDualHttpBinding> 
       <binding name="WSDualHttpBinding_IReportReceiver" closeTimeout="00:01:00" 
        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
        bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
        maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
        messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true"> 
        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
         maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
        <reliableSession ordered="true" inactivityTimeout="00:10:00" /> 
        <security mode="Message"> 
         <message clientCredentialType="Windows" negotiateServiceCredential="true" 
          algorithmSuite="Default" /> 
        </security> 
       </binding> 
      </wsDualHttpBinding> 
+1

任何機會你都可以發佈你的web.config和你的app.config?並且留下關於你必須做什麼防火牆改變的信息? – 2014-07-16 13:34:32

相關問題