我可以通過Windows窗體程序調用第三方供應商的Web服務。當我嘗試調用從一個WCF Web服務,我得到了下面的錯誤相同的Web服務和Web方法和相同的URL:「無法連接到遠程服務器」
ExportValuationPolicyNumber:Exception=System.Net.WebException: Unable to connect to the remote server --->
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed
because connected host has failed to respond 66.77.241.76:80
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at TFBIC.RCT.WCFWebServices.ExpressLync.ValuationServiceWse.ExportValuationPolicyNumber(String PolicyNumber) in c:\Source\TFBIC.RCT.WCFWebServices\TFBIC.RCT.WCFWebServices\Web References\ExpressLync\Reference.cs:line 519
at TFBIC.RCT.WCFWebServices.ValuationService.ExportValuationPolicyNumber(String PolicyNumber) in c:\Source\TFBIC.RCT.WCFWebServices\TFBIC.RCT.WCFWebServices\ValuationService.svc.cs:line 97
基本上,我試圖寫爲供應商的.asmx/WSE3一個WCF包裝服務。讓我們不要錯過 - 但微軟表示WCF可以調用WSE3,但只有打開SSL,我的供應商纔會相信 - 不允許SSL連接。所以我堅持寫包裝,所以我可以從BizTalk 2009調用。現在,我通過Console程序測試包裝。
我甚至可以做些什麼來調試?我在WCF服務之前和之後添加了EventLog跟蹤,在這裏它調用了.asmx服務 - 所以我知道這是它吹來的地方(加上上面錯誤中的行號)。
我在我的web.config以下:
<microsoft.web.services3>
<diagnostics>
<trace enabled="true"
input="c:\inetpub\wwwroot\wsetraces\InputTrace.webinfo"
output="c:\inetpub\wwwroot\wsetraces\OutputTrace.webinfo" />
<detailedErrors enabled="true" />
</diagnostics>
</microsoft.web.services3>
,我已經給該目錄的完全訪問每個人 - 但沒有跟蹤在那裏出現。
有什麼東西我可以找或嘗試旁邊調試呢?
從理論上講,「ping」結果應該不重要,因爲該網站正在使用Windows窗體程序進行工作,該窗口程序稱它爲好。
然而 - 這裏是中國平安表示,它看起來有點可疑的對我說:
C:\用戶\ uxnxw01>平rct.msbexpress.net
Pinging rct.msbexpress.net [66.77.241.56] with 32 bytes of data:
Reply from 10.193.99.5: Destination net unreachable.
Reply from 10.193.99.5: Destination net unreachable.
Request timed out.
Reply from 10.193.99.5: Destination net unreachable.
Ping statistics for 66.77.241.56:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
感謝,
Neal Walters
WireShark分析
我確實運行過Wireshark - 在下面的評論中發佈了一些結果。但是,閱讀更多內容後,它並不總是說「Destination Unreachable」。但在失敗的情況下,我從來沒有得到任何數據。我仍然困惑下一步該做什麼。我一直在比較數據包,但速度緩慢且令人困惑。例如,我仍然沒有找到在請求數據包中傳遞的密鑰(特定的policyNum)。我還在工作中看到了一些「Destination Unreachable」聲明。
在那個工程中,我從來沒有看到66.77.241.76,我只看到我們公司的代理。但是我看不到任何會告訴WSE3使用或不使用代理的配置(或代碼)。
的Telnet結果:
C:\Users\uxnxw01>telnet 66.77.241.56 80
Connecting To 66.77.241.56...Could not open connection to the host, on port 80:
Connect failed
C:\Users\uxnxw01>telnet 66.77.241.76 80
Connecting To 66.77.241.76...Could not open connection to the host, on port 80:
Connect failed
我不知道這是什麼證明。就像我說的那樣,我可以通過直接調用它的WSE3接口,從Windows窗體調用相同的Web服務。我知道我可以那樣到達那裏。
我在想這兩個程序的主要區別在於它是在Win Form下運行並直接調用WSE3。那個可以工作。發生故障的基本上是99%相同的代碼,作爲WCF服務發佈,所以它在IIS下運行(然後控制檯程序調用我的機器上的WCF/IIS服務,該服務又調用WSE3服務)。
是否有某些原因IIS不會使用相同的代理?
是的,根據我的答案中的第三個選項。 ;-) – 2009-11-18 16:12:18
你也可以做到這一點在web.config中 ' \t <代理usesystemdefault = 「假」 proxyaddress = 「HTTP://your.proxy.ip」/> defaultProxy> ' –
Ketan
2012-07-13 20:53:58