.NET Framework Bookmark and Share   
 index > .NET Remoting and Runtime Serialization > I got " Exception:: System.Net.WebException" in WCF server(BasicHttpBinding) and ASP.NET 2.0 WebService Client
 

I got " Exception:: System.Net.WebException" in WCF server(BasicHttpBinding) and ASP.NET 2.0 WebService Client

Hi~

I have a WCF server(BasicHttpBinding) And client refer server as a webreference.
Normally it work well.
But when server respond with large size message,The exception occurs.

exception is

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)

Please help me.

  • Edited bymakersj Friday, August 14, 2009 9:40 AM
  •  
makersj
I am having a similar issue (I'm using wsHttpBinding) - each time I'm sending a data chunk that I have gotten from an Oracle database, a System.Net.Sockets.SocketExceptionerror occurs that "An existing connection was forcibly closed by the remote host"

Wonderfully enough, if I DON'T download data from the database, it works just fine.

Has anyone managed to resolve this issue?

EDIT: My answer was that DbNull is likely non-serializable and thus I couldn't send it via the service. I have manually went through data and converted it into standard values (DbNull=> null) and it worked.
alexsilverrose
You are probablyhitting the close timeout defined for your binding. try increasing the time inthebindingof the client config file.

<

binding name="External" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
...
</
binding>


After each operation call, client.Close should be called.

Happy Coding!


kashif
Kpbutt

You can use google to search for other answers

Custom Search

More Threads

• Simple remoting program throws system.security.securityexception
• How to know when a CAO client has close?
• Stream.Read fails in a remoting application - Part 2
• multiple singleton objects from the same server
• How to execute a program remotely?
• cross-appdomain remoting problem
• Windows service or IIS??
• .Net remoting accessing hosting application objects
• How does filestream works in .net remoting?
• XmlSerialzer: why is it so slow?