简体   繁体   中英

ASMX WebService not working on LIVE server

I have a simple ASMX webservice that connects to a SQL database. I also have accompanying webservice tester app.

I have tested both these components on my dev machine, and on my own Windows 2008 server. When I deploy it to the customer's server, the webservices service landing page works fine both being called on the server and remotely, however, the webservice tester will not work at all from any location. It throws an Exception

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.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 WebServiceTester.frmMain.btnCallWS_Click`

When the error occurs, nothing appears in the Windows Event Viewer, SQL Logs or IIS logs. Any ideas what could be causing this?

Are you trying to process large requests? IIRC correctly, the default max is 4MB and your can get this error.

In the Web.config file, override the value of maxRequestLength for the application. For example, the following entry in Web.config allows files that are less than or equal to 1 GB to be uploaded:

<httpRuntime maxRequestLength="1048576" />

IIRC the absolute max is 2GB in the 2.0 framework, never look for a reason to try a large value than this.

EDIT -- More detail

Some firewalls can distinguish between GET and POST requests, so it is possible that you use browser to GET, but are blocked in a POST. If you want to debug the network traffic you might find it easier if you can replicate the POST within say the Chrome browser (easy to wire up a hard coded post via JQuery), then you can use the browser to inspect the headers, etc. Or you can use Fiddler (a great app), see Configure .NET Application for Fiddler to debug your testing app with Fiddler (assuming it is a winform app based on your stack trace)

Finally got to the bottom of this. Had to use Windbgx86 to analyse the w3wp.exe crash minidump and load the symbols from Microsoft and the sos.dll as per these instructions http://vstepic.blogspot.co.uk/2012/03/how-to-debug-iis-75-application-pool.html (cant thank the author of that document enough!!!)

The only difference was that I had to run "!pe -nested" rather than "!CLRstack".

This dumped out several messages all with the same error. There was a missing library DLL on the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM