En el proyecto que actualmente trabaja, no se expone un servicio WCF que devuelve una matriz de una entidad empresarial, llamémoslo factura:
Invoice[] GetInvoicesByTypeAndTime(InvoiceType invoiceType, byte startHour, byte? endHour); El mecanismo de autenticación se utiliza la autenticación de Windows, el servicio de WCF se hospeda en una aplicación Web alojado en IIS 6.
Al principio, cuando he usado para obtener datos de más de un 64 kB CommunicationException fue arrojado afirmando que "La cuota de tamaño máximo de mensaje para los mensajes entrantes (65536) ha sido superado. Para aumentar la cuota, utilice la propiedad MaxReceivedMessageSize en el elemento de enlace correspondiente."
Muy bien, me acaba de aumentar en App.config los valores de 65536000 (I descaradamente agregó tres ceros al final) para maxReceivedMessageSize y maxBufferSize (este último ya que se quejó en una ArgumentException que "Para TransferMode.Buffered, MaxReceivedMessageSize y MaxBufferSize debe ser la mismo valor Nombre de parámetro:. BindingElement ").
Ahora yo podría recibir más respuestas ...
Hasta que chocó con otro límite (CREO) en que después de 624 elementos (aprox. 2.2 MB), una extraña excepción se produce:
System.ServiceModel.Security.MessageSecurityException:La solicitud HTTP no está autorizado a "negociar" esquema de autenticación de cliente. El encabezado de autenticación recibido del servidor era "negociar, NTLM". ---> System.Net.WebException: El servidor remoto devolvió un error: (401) no autorizado. en System.Net.HttpWebRequest.GetResponse () en System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply (tiempo de espera TimeSpan) --- Fin del seguimiento de pila de excepción interna --- Servidor de seguimiento de la pila:
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.Llame al (acción String, Boolean ida, ProxyOperationRuntime operación, Object [in], Object [out]) en System.ServiceModel.Channels.ServiceChannelProxy.InvokeService (IMethodCallMessage methodCall, ProxyOperationRuntime operación) en System.ServiceModel.Channels.ServiceChannelProxy.Invoke (IMessage mensaje) Excepción relanzada en [0]:
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 ¿Hay un límite en las respuestas autenticado? ¿Hay un límite a partir de la configuración de ASP.NET?
Echa un vistazo a ReaderQuotasen el lado del cliente, si desea la versión TLDR - para ver si esto es realmente el problema, puede establecer el máximo de (Int32.MaxValue) como se muestra a continuación.
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> Este texto ha sido obtenida de esta fuente original en Stackoverflow.com
Tags: asp.net, wcf, windows-authentication, communicationexception, questions
| Date: 25-10-2012
Search the best 2TB External Hard Drives available on the market.