简体   繁体   English

ASMX WebService在LIVE服务器上不起作用

[英]ASMX WebService not working on LIVE server

I have a simple ASMX webservice that connects to a SQL database. 我有一个连接到SQL数据库的简单ASMX Web服务。 I also have accompanying webservice tester app. 我也有随附的webservice测试器应用程序。

I have tested both these components on my dev machine, and on my own Windows 2008 server. 我已经在开发机器和自己的Windows 2008服务器上测试了这两个组件。 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. 当我将其部署到客户的服务器上时,无论在服务器上还是在远程调用,webservices服务登录页面都可以正常工作,但是,webservice测试器根本无法在任何位置运行。 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. 发生错误时,Windows事件查看器,SQL日志或IIS日志中均不显示任何内容。 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. IIRC正确,默认最大为4MB,您会收到此错误。

In the Web.config file, override the value of maxRequestLength for the application. 在Web.config文件中,为应用程序覆盖maxRequestLength的值。 For example, the following entry in Web.config allows files that are less than or equal to 1 GB to be uploaded: 例如,Web.config中的以下条目允许上传小于或等于1 GB的文件:

<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. IIRC在2.0框架中的绝对最大值为2GB,请不要寻找理由尝试更大的值。

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. 有些防火墙可以区分GET和POST请求,因此可能使用浏览器进行GET,但在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) 如果您想调试网络流量,则可以在Chrome浏览器中复制POST(通过JQuery轻松连接硬编码的帖子),会发现更容易,然后可以使用浏览器检查标题等。或者,您可以使用Fiddler(一个出色的应用程序),请参阅为Fiddler配置.NET应用程序以使用Fiddler调试测试应用程序(假设它是基于堆栈跟踪的Winform应用程序)

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!!!) 必须按照以下说明使用Windbgx86分析w3wp.exe崩溃小型转储并从Microsoft和sos.dll加载符号,网址为http://vstepic.blogspot.co.uk/2012/03/how-to-debug-iis -75-application-pool.html (请非常感谢该文档的作者!!!)

The only difference was that I had to run "!pe -nested" rather than "!CLRstack". 唯一的区别是我必须运行“!pe -nested”而不是“!CLRstack”。

This dumped out several messages all with the same error. 这转储了几条都带有相同错误的消息。 There was a missing library DLL on the server. 服务器上缺少库DLL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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