W
Wil Peck
So here is the scenario...
I have a console application executing a Web Method on my WSDL generated
System.Web.Protocols.SoapHttpClientProtocol instance using HTTP over a VPN.
For some reason requests that are larger than 1024 bytes are timing out and
the stack trace ends up being something like the above. I can't find where
there are any maxRequestLength (that applies to requests a client makes to a
web service) that can be adjusted to accommodate for larger requests.
Below is an snippet of the stack trace minus any proprietary info.
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.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)
I have done a trace on the System.Net.Sockets which seems to show that the
request wasn't really completed by the SoapHttpClientProtocol instance.
Please note that this was working fine until we applied patches to our Win2k
machine and then after the patches were applied it stopped working. I have
been able to get the service to work on WinXP fully patched, but not on
Windows Server 2k3 or Win Server 2k.
My hunch is the request is never fully written to the host of the web
service and the web service finally decides to close the connection because
it received an incomplete message. In an attempt to give the request more
time to complete I have increased the WebClientProtocol.Timeout to 2 minutes
without any success. If anyone has any other ideas on this it would be
greatly appreciated.
Thanks - Wil
I have a console application executing a Web Method on my WSDL generated
System.Web.Protocols.SoapHttpClientProtocol instance using HTTP over a VPN.
For some reason requests that are larger than 1024 bytes are timing out and
the stack trace ends up being something like the above. I can't find where
there are any maxRequestLength (that applies to requests a client makes to a
web service) that can be adjusted to accommodate for larger requests.
Below is an snippet of the stack trace minus any proprietary info.
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.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)
I have done a trace on the System.Net.Sockets which seems to show that the
request wasn't really completed by the SoapHttpClientProtocol instance.
Please note that this was working fine until we applied patches to our Win2k
machine and then after the patches were applied it stopped working. I have
been able to get the service to work on WinXP fully patched, but not on
Windows Server 2k3 or Win Server 2k.
My hunch is the request is never fully written to the host of the web
service and the web service finally decides to close the connection because
it received an incomplete message. In an attempt to give the request more
time to complete I have increased the WebClientProtocol.Timeout to 2 minutes
without any success. If anyone has any other ideas on this it would be
greatly appreciated.
Thanks - Wil