我已經創建了一個WCF服務,該服務在W2008服務器上運行一個操作並作爲結果返回一個數據結構。問題是,這個結果可能比標準服務配置似乎接受的要大。所以我試圖增加(或刪除)這個最大尺寸,但看起來,我沒有找到正確的屬性。移除WCF服務答案的大小限制
在WCF的App.config中,我改變了我的basicHttpBinding的以下值:
- MaxBufferPoolSize - > 6553600
- MAXBUFFERSIZE - > 6553600
- MaxReceiveMessageSize - > 6553600
ReaderQuotas:
- MaxArrayLenght - > 0
- MaxBytesPerRead - > 0
- MAXDEPTH - > 0
- MaxNameTableCharCount - > 0
- MaxStringContentLength - > 0
然後我開始WCF的TestClient的調用服務。我確信,basicHttpBinding的屬性值等於配置中的值。當我以某種方式調用服務時,結果集相當小,一切正常。但是當這個大小增加時,我最終得到錯誤(從德語翻譯):
接收http答案http://localhost:8731/Design_Time_Addresses/DiscoDataSource/Service1/時出錯。可能的原因:端點綁定不使用HTTP協議,或HTTP-requestcontext被服務器取消。
服務器堆棧跟蹤:
在System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(引發WebException引發WebException,HttpWebRequest的請求,HttpAbortReason abortReason)
在System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply (時間跨度超時)
在System.ServiceModel.Channels.RequestChannel.Request(消息消息,時間跨度超時)
System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息消息,時間跨度超時)
在System.ServiceModel.Channels.ServiceChannel.Call(字符串動作,布爾單向,ProxyOperationRuntime操作,對象[]項,對象[]奏,時間跨度超時)
在System.ServiceModel.Channels.ServiceChannel.Call(字符串動作,布爾單向,ProxyOperationRuntime操作,對象[]項,在System.ServiceModel.Channels對象[]奏)
。 ServiceChannelProxy.InvokeService(IMethodCallMessage方法調用,ProxyOperationRuntime操作)
at System.ServiceModel.Channels.ServiceChannelProxy。調用(IMessage消息)
我想將服務配置爲返回結果,而不管大小。任何人都知道,我需要改變配置?
由於提前, 弗蘭克
Whoho!你擊中了頭部,非常感謝!它現在的作品:) – Aaginor 2009-12-09 16:18:08
很高興成爲服務。 :) – Randolpho 2009-12-09 19:07:53