简体   繁体   English

Asmx Web服务有时无法响应

[英]Asmx web service sometimes won't respond

I have a .asmx web service on SharedHosting server which won't respond in some cases. 我在SharedHosting服务器上有一个.asmx Web服务,在某些情况下不会响应。 It works when suddenly it stopped working and doesn't work for a couple hours and it work againg. 当突然停止工作并且几个小时不工作并再次工作时,它可以工作。 When it stopped working I upload web.config file ( wirhout any change in file, just upload and overwrite file wia ftp) on server and web service starts behave normaly until next time when it stopped working. 当它停止工作时,我在服务器上上传了web.config文件(文件中没有任何更改,只需上传并覆盖ftp),Web服务便开始正常运行,直到下一次停止工作为止。

Web.config Web.config文件

<configuration>
   <system.web>
       <compilation debug="false" targetFramework="4.0"/>
   </system.web>
</configuration>

What I'm doing wrong? 我做错了什么? I assume it's problem with web.config file. 我认为这是web.config文件的问题。 Probably it's missing some configuration. 可能缺少某些配置。

No. It is not a problem with your web.config file. 否。您的web.config文件不是问题。
When you upload a new web.config, you cause IIS to reset your application. 当您上载新的web.config时,会导致IIS重置您的应用程序。

This does solve your problem, but is not your root cause. 这确实可以解决您的问题,但不是您的根本原因。
Implement logging to keep checks on the memory your application is using. 实现日志记录以检查您的应用程序正在使用的内存。

An application reset can solve a lot of memory issues. 重置应用程序可以解决很多内存问题。
I am guessing you have a memory leak, that after a few hours cause your application to hang. 我猜你有一个内存泄漏,几个小时后导致您的应用程序挂起。

sounds like your web service is buggy. 听起来您的网络服务有问题。 By uploading the web.config you will be restarting the IIS apppool (effectivly doing this: http://technet.microsoft.com/en-us/library/cc732742(v=ws.10).aspx ), this will restart the service so this is why it works when you change/upload a new web.config. 通过上传web.config您将重新启动IIS应用程序池(有效地执行此操作: http ://technet.microsoft.com/zh-cn/library/cc732742(v=ws.10) .aspx ),这将重新启动服务,因此这就是为什么当您更改/上传新的web.config时它可以工作的原因。 You need to diagnose what the issue is with the service, the web.config isn't the problem 您需要诊断服务出了什么问题, web.config不是问题

在运行服务的计算机上查看应用程序和系统事件日志,以获取有关服务崩溃的线索

I had had the same problem. 我遇到了同样的问题。 The reason is probably your data layer. 原因可能是您的数据层。 You should check all methods and check if you are properly disposing the connections with a using block. 您应该检查所有方法,并检查是否using块正确布置了连接。 To test this theory, open your SQL Profile, and look for "audit logout" several times. 要测试该理论,请打开您的SQL Profile,然后多次查找“审计注销”。

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

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