2016-04-28 97 views
0

我使用nettcp結合,並在WCF服務成功發送對象,但不能接收(含同一對象的返回類型)的響應,並得到以下錯誤:WCF客戶端無法接收對象

The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:02:59.9990000'. System.ServiceModel.CommunicationException

有人遇到過和我一樣的問題嗎?任何幫助都會有所幫助。

+1

你有沒有試過改變超時? 3分鐘聽起來是正常的,但如果你的數據是那麼大,它需要更長的時間... – BugFinder

+0

我試着返回一個整數,但也無法這樣做,最初超時是40分鐘(正在接收相同的錯誤)。 – FaizanRabbani

+0

然後Id建議需要一個最小可行的可重複代碼 – BugFinder

回答

0

我試圖改變WCF從nettcp結合到http,但只有改變錯誤我收到即

An error occurred while receiving the HTTP response .. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

正如它所說的「見服務器日誌以瞭解更多詳細信息」,我回顧了WCF日誌並指出在序列化對象時發生錯誤,我在DataContract上用KnownType屬性修飾了該對象的類,並且它工作正常。

相關問題