6 Months Free & No Setup Fees ASP.NET Hosting!
Skip Navigation Links
C# Corner Home
Forum Home
Latest 50
Unanswered
Win Prizes
All Time Leaders
Jump to CategoryExpand Jump to Category
Login 
    Welcome Guest!
 Search Forum For :  
X
 Login
Please login to submit a new post, reply and edit exiting posts, see user profiles, and access more features. If you are not a registered member, Register here.
User Id / Email:
Password:  
Forgot Password | Forgot UserName
   Home » WCF » Exception when size is too big
       
Author Reply
Stefan Lehmann
posted 6 posts
since Feb 10, 2012 
from

Exception when size is too big

  Posted on: 10 Feb 2012       
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!
Suthish Nair
posted  4906 posts
since  Jul 09, 2009 
from  India

 Re: Exception when size is too big
  Posted on: 13 Feb 2012        0  
Thread Resolved?
Sam Hobbs
posted  6490 posts
since  Sep 07, 2009 
from  Los Angeles, California, USA

 Re: Exception when size is too big
  Posted on: 13 Feb 2012        0  
Die meisten von uns sprechen kein Deutsch. Es würde helfen, wenn Sie eine Übersetzung zur Verfügung gestellt.
Thinking is a feeling; pleasant for some and unpleasant for others.
Stefan Lehmann
posted  6 posts
since  Feb 10, 2012 
from 

 Re: Exception when size is too big
  Posted on: 14 Feb 2012        0  
This is the wohle Exception, before i try to translate it into english:

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:

Stefan Lehmann
posted  6 posts
since  Feb 10, 2012 
from 

 Re: Exception when size is too big
  Posted on: 14 Feb 2012        0  
i think this is the exception in english:

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)
Sam Hobbs
posted  6490 posts
since  Sep 07, 2009 
from  Los Angeles, California, USA

 Re: Exception when size is too big
  Posted on: 14 Feb 2012        0  
Danke. Das hilft.

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?
Thinking is a feeling; pleasant for some and unpleasant for others.
Stefan Lehmann
posted  6 posts
since  Feb 10, 2012 
from 

 Re: Exception when size is too big
  Posted on: 14 Feb 2012        0  
Thank you for your answer. What could that be for example?
is it possible that i have to change something on my IIS?
Stefan Lehmann
posted  6 posts
since  Feb 10, 2012 
from 

 Re: Exception when size is too big
  Posted on: 14 Feb 2012        0  
The exception is thrown either when i install my apllication which uses an IIS on a real Webserver but also when i
test it on my local machine (IIS also on my local machine). Perhaps this helps?
Sam Hobbs
posted  6490 posts
since  Sep 07, 2009 
from  Los Angeles, California, USA

 Re: Exception when size is too big
  Posted on: 14 Feb 2012        0  
I cannot help beyond here; I don't have the experience to know what to do. My guess is that there is little anyone here can help; you need to do some analysis of your system. Perhaps someone can help you to do the analysis.
Thinking is a feeling; pleasant for some and unpleasant for others.
Stefan Lehmann
posted  6 posts
since  Feb 10, 2012 
from 

 Re: Exception when size is too big
  Posted on: 14 Feb 2012        0  
Sorry for your help but i resolved the problem now.
i needed to put in following in the web.config:

<system.web>
    <httpRuntime maxRequestLength="204800" executionTimeout="7200"/>

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 Hobbs
posted  6490 posts
since  Sep 07, 2009 
from  Los Angeles, California, USA

 Re: Exception when size is too big
  Posted on: 14 Feb 2012        0  
Good to hear that you figured it out.

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.
Thinking is a feeling; pleasant for some and unpleasant for others.
       
Nevron Gauge for SharePoint
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
6 Months Free & No Setup Fees ASP.NET Hosting!
 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Advertise with us
Current Version: 5.2011.3.12
 © 1999 - 2012  Mindcracker LLC. All Rights Reserved