2009-11-13 30 views
0

我有一個簡單的ASP.NET Web應用程序,它使用WCF客戶端與簡單的WCF支持的Windows服務對話。WCF,客戶端無法連接,除非在同一臺機器上

所有在當地環境中運行良好。我們部署到開發,這也工作得很好。但是在DEV上 - Web服務器和App服務器位於同一臺計算機上。

現在我們已經部署到QA,我們得到'套接字連接被中止。 '異常拋出異常。 出於某種原因,我們的QA Web服務器無法通過我們的WCF客戶端/服務與我們的QA應用程序服務器通信。 我可以從Web服務器ping QA應用服務器 我可以telnet從Web服務器 的QA應用服務器,我可以連接到從Web服務器

的QA應用服務器上的HTTP WSDL和,我可以連接從我的LOCAL環境/視覺工作室向我的QA服務提供FINE !!!

那麼,爲什麼我的QA ASP.NET應用程序無法與我的QA WCF Windows服務交談?我試圖在一切可能的方式,仍然沒有去...

這裏是我的客戶端部分System.ServiceModel:

<system.serviceModel> 
    <bindings> 
     <netTcpBinding> 
     <binding name="BigFileBinding"> 
      <!-- required to receive files greater then default size of 16kb --> 
      <readerQuotas maxArrayLength="5242880"/> 
     </binding> 
     </netTcpBinding> 
    </bindings> 
    <client> 
     <endpoint address="net.tcp://NJQACNET01:58887/PriceService" 
      binding="netTcpBinding" 
      contract="IPriceService" 
      bindingConfiguration="BigFileBinding"/> 
     </endpoint> 
    </client> 
    </system.serviceModel> 

這裏是關於服務我system.servicemodel部分:

<system.serviceModel> 
    <bindings> 
     <netTcpBinding> 
     <!-- required to receive files greater then default size of 16kb --> 
     <binding name="BigFileBinding" 
       maxReceivedMessageSize="5242880"> 
      <readerQuotas maxArrayLength="5242880"/> 
     </binding> 
     </netTcpBinding> 
    </bindings> 
    <services> 
     <service behaviorConfiguration="MetaDataBehavior" name="RK.Pricing.PricingPortal.MarketableSecuritiesService.PriceService"> 
     <endpoint address="net.tcp://localhost:58887/PriceService" binding="netTcpBinding" 
      contract="RK.Pricing.PricingPortal.MarketableSecuritiesService.IPriceService" bindingConfiguration="BigFileBinding" /> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:58889/PriceService" /> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="MetaDataBehavior"> 
      <serviceMetadata httpGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="true"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

非常感謝您的幫助!非常感謝..

回答

1

這可能是一個防火牆問題,您使用的端口在ASP.Net QA服務器和WCF QA服務器之間被阻止。

您可以使用telnet命令來測試它。

+0

我能夠遠程登錄到Web服務器的相同端口到應用程序服務器而沒有問題...此外,我只是嘗試在客戶端和服務器上設置'安全模式=「無」,現在一切正常。 ..但在什麼成本..?..... – dferraro 2009-11-13 18:23:18

+0

成本將是任何客戶可以打電話給你的服務。關閉安全絕對不推薦。查看我在答案中鏈接的指導原則。 – 2009-11-13 18:25:59

+0

@dferraro,在將它們更改爲none之前,您的安全設置是什麼? ASP.net服務器在同一個域中嗎?哪個用戶上下文是從ASP.Net服務器到WCF服務器的調用? – 2009-11-13 18:49:34

1

我認爲這可能是一個安全問題。請記住,默認情況下,NetTcpBinding使用Windows身份驗證。

如果可能,您應該查看並遵循公佈的here指南。

相關問題