Pozdrav svima,
Imam problem sa WCF servisom i
predpostavljam "velikom" količinom podataka koju pokušavam da povučem iz baze. Web servis sam napravio po modelu Biblioteka + Host.
Host mi koristi binarni binding.
<binding name="binaryHttpBinding">
<binaryMessageEncoding/>
<httpTransport/>
</binding>
Kada pokrenem klijentsku aplikaciju, ona uspeva da odradi par zahteva ka web servisu, koji ne zahtevaju mnogo podataka, možda 300-500 redova iz baze. Međutim jedna storna procedura vraća 24000 redova iz baze, gde svaki red ima 170 kolona. Nije to Bog zna šta, ali kada pokušam da napravim taj request ka servisu, klijentska aplikacija puca sa sledećim exceptionom :
-----------------------
System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to
http://localhost/Service. 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. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
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.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at WebService.nekaMetoda()
at WebServiceClient.nekaMetoda() in E:\putanja-do-klijentske-aplikacije\myProxy.cs:line 9264
at Client.Program.Main(String[] args) in E:\putanja-do-klijentske-aplikacije\Program.cs:line 29
U klijentskoj aplikaciji, app.config fajlu sam promenio sve živo na 536870912, ali opet baca ovaj exception, kao da nije do veličine podataka. Probao sam i sa 2 milijarde, ali opet isto. Nije mi jasno kako radi sa malo podataka, a kad je malo više podataka onda izbaci exception. Nije mi iskreno ni jasno zašto izbacuje ovaj exception, jedino objašnjenje i moguće rešenje za ovaj problem koje sam uspeo da nađem na netu je bilo da je problem u podešavanjima veličina u klijentskoj aplikaciji, ali i kad postavim na maksimalne veličine moguće opet izbacuje isti exception.
<bindings>
<customBinding>
<binding name="CustomBinding_WebService">
<binaryMessageEncoding maxReadPoolSize="536870912" maxWritePoolSize="536870912"
maxSessionSize="536870912">
<readerQuotas maxDepth="536870912" maxStringContentLength="536870912" maxArrayLength="536870912"
maxBytesPerRead="536870912" maxNameTableCharCount="536870912" />
</binaryMessageEncoding>
<httpTransport manualAddressing="false" maxBufferPoolSize="536870912"
maxReceivedMessageSize="536870912" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="536870912" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />
</binding>
</customBinding>
<wsHttpBinding>
<binding name="MetadataExchangeHttpBinding_IMetaDataExchange"
closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="536870912"
maxReceivedMessageSize="536870912" messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="536870912" maxStringContentLength="536870912" maxArrayLength="536870912"
maxBytesPerRead="536870912" maxNameTableCharCount="536870912" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
Unapred zahvalan! Svaka pomoć je dobrodošla!