在我目前是有暴露它返回一個商業實體的陣列WCF服務工作的項目,讓我們把它發票:WCF響應 - 驗證錯誤
Invoice[] GetInvoicesByTypeAndTime(InvoiceType invoiceType, byte startHour, byte? endHour);
的身份驗證機制使用是Windows身份驗證,WCF服務託管在託管在IIS 6上的Web應用程序中。
首先,當我用於獲取超過64kB的數據時,拋出CommunicationException,指出「傳入消息的最大消息大小配額(65536 )已超出。要增加配額,請使用適當的MaxReceivedMessageSize屬性綁定元素「。很好,我只是在App.config中將值增加到65536000(我最後在最後添加了三個零),這兩個值都是maxReceivedMessageSize和maxBufferSize(後者是因爲它在ArgumentException中抱怨「對於TransferMode.Buffered,MaxReceivedMessageSize和MaxBufferSize必須是相同的值。 參數名稱:bindingElement「)。
現在我能得到更大的反應......
直到我打了另一個極限(我認爲)後624元一個奇怪的異常被拋出(約2.2 MB):
System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
服務器堆棧跟蹤:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Test2.DBS.IDbService.GetInvoicesByTypeAndTime(InvoiceType invoiceType, Byte startHour, Nullable`1 endHour)
at Test2.DBS.DbServiceClient.GetInvoicesByTypeAndTime(InvoiceType invoiceType, Byte startHour, Nullable`1 endHour) in D:\TEMP\Test2\Test2\Service References\DBS\Reference.cs:line 1445
at Test2.Program.Main(String[] args) in D:\TEMP\Test2\Test2\Program.cs:line 19
:在[0]
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest request, HttpWebResponse response, WebException responseException, HttpChannelFactory factory)
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
異常重新拋出
驗證響應是否有限制? ASP.NET設置有沒有限制?
感謝的Yannick M.重新格式化:) – 2010-01-13 09:54:21