Hello together,
i have a problem with my WCF Service when the size is to big. I get following exception:
Fehler beim Empfangen der HTTP-Antwort für http://localhost:52277/ServiceKalkulation.svc. Die Ursache kann sein, dass die Dienstendpunktbindung kein HTTP-Protokoll verwendet. Eine andere mögliche Ursache ist, dass der HTTP-Anforderungskontext vom Server abgebrochen wird (vermutlich auf das Herunterfahren des Diensts zurückzuführen). Weitere Informationen finden Sie in den Serverprotokollen.
Inner Exception: Von der Übertragungsverbindung können keine Daten gelesen werden: Eine vorhandene Verbindung wurde vom Remotehost geschlossen.
If i try to debug into my Wcf Service i see that it already fails before i get into my method of the Wcf Service.
This is the method the exception is thrown, but i never come in my "SaveLastVersion"-method, the exception is thrown before:
client.SaveLastVersion(lastV, dateiToByte);
Size of lastV: 23669380 (byte[23669380 ])
Size of dateiTByte: 3119608 ([byte[3119608])
I searched a long time but i cant get the right answer to solve my problem.
Thanks for helping!
Loading
Sam HobbsPosted Feb 14, 2012, 8:05 PM
I think there are relevant articles in this web site. I think that one reason the size limit is small is to limit the effectiveness of a Denial of Service attack. You should look for relevant articles.
Stefan LehmannPosted Feb 14, 2012, 6:48 AM
i needed to put in following in the web.config:
The maxRequestLength in IIS 6 is set to 4MB but you do not see this section in your web.config you have to put it in by hand.
In my opinion 4Mb is someting like a bad joke... ^^
Thanks for helping!
Sam HobbsPosted Feb 14, 2012, 6:38 AM
Stefan LehmannPosted Feb 14, 2012, 6:20 AM
test it on my local machine (IIS also on my local machine). Perhaps this helps?
Stefan LehmannPosted Feb 14, 2012, 6:13 AM
is it possible that i have to change something on my IIS?
Sam HobbsPosted Feb 14, 2012, 5:49 AM
Thank you. That helps.
Probably the important part is the part that says that an "existing connection was forcibly closed by the remote host". So there seems to be something happening at the other end. It might be a hardware problem with the connection or something else. Does it seem reasonable that that could be the problem?
Stefan LehmannPosted Feb 14, 2012, 5:24 AM
Message = "The underlying connection was closed: An unexpected error occurred on a receive."
Response = null
Source = "System.Web.Services"
Status = System.Net.WebExceptionStatus.ReceiveFailure
StackTrace:
at: System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
at: System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
at: System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at: Edison.Controller.LogArchive.QueryLogService.QueryLog(SearchCondition searchCondition, Log[]& logs, Int32& toalCount, Boolean& toalCountSpecified)
at: Edison.Controller.LogController.GetLogList(String userSessionKey, LogSearchConditionDto condition, Log[]& logs, Int32& totalCount)
Target Site = "System.Net.WebResponse GetWebResponse(System.Net.WebRequest)" InnerException
System.IO.IOException : "sending connection An existing connection was forcibly closed by the remote host"
StackTrace :
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)
InnserException
System.Net.Sockets.SocketException : "An existing connection was forcibly closed by the remote host"
NativeErrorCode : 10054
SocketErrorCode : System.Net.Sockets.SocketError.ConnectionReset
StackTrace :
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)
Stefan LehmannPosted Feb 14, 2012, 4:52 AM
System.ServiceModel.CommunicationException was caught
Message=Fehler beim Empfangen der HTTP-Antwort für http://localhost:52277/ServiceKalkulation.svc. Die Ursache kann sein, dass die Dienstendpunktbindung kein HTTP-Protokoll verwendet. Eine andere mögliche Ursache ist, dass der HTTP-Anforderungskontext vom Server abgebrochen wird (vermutlich auf das Herunterfahren des Diensts zurückzuführen). Weitere Informationen finden Sie in den Serverprotokollen.
Source=mscorlib
StackTrace:
Server stack trace:
bei System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
bei System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
bei System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
bei System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
bei System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
bei Gesec.ServiceReferenceKalkulation.IServiceKalkulation.SaveLastVersion(angebotLastVersion lastVersion, Byte[] dateiInByte)
bei Gesec.ServiceReferenceKalkulation.ServiceKalkulationClient.SaveLastVersion(angebotLastVersion lastVersion, Byte[] dateiInByte) in D:\Projekte\GesecNeu\Gesec\trunk\GesecProject\Gesec\Gesec\Service References\ServiceReferenceKalkulation\Reference.cs:Zeile 13733.
bei Gesec.FileHandler.FileSave(AngebotViewModel a) in D:\Projekte\GesecNeu\Gesec\trunk\GesecProject\Gesec\Gesec\CentralWorkflow\Angebot\Helper\FileHandler.cs:Zeile 297.
bei Gesec.CentralWorkflow.Angebot.UserControls.view_Angebot.FileSaveHandler(Object sender, ExecutedRoutedEventArgs e) in D:\Projekte\GesecNeu\Gesec\trunk\GesecProject\Gesec\Gesec\CentralWorkflow\Angebot\UserControls\view_Angebot.xaml.cs:Zeile 1295.
InnerException: System.Net.WebException
Message=Die zugrunde liegende Verbindung wurde geschlossen: Unbekannter Fehler beim Empfangen..
Source=System
StackTrace:
bei System.Net.HttpWebRequest.GetResponse()
bei System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
InnerException: System.IO.IOException
Message=Von der Übertragungsverbindung können keine Daten gelesen werden: Eine vorhandene Verbindung wurde vom Remotehost geschlossen.
Source=System
StackTrace:
bei System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
bei System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
bei System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
InnerException: System.Net.Sockets.SocketException
Message=Eine vorhandene Verbindung wurde vom Remotehost geschlossen
Source=System
ErrorCode=10054
NativeErrorCode=10054
StackTrace:
bei System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
bei System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
InnerException:
Sam HobbsPosted Feb 13, 2012, 5:31 PM
Suthish NairPosted Feb 13, 2012, 11:22 AM