简体   繁体   中英

Asmx web service sometimes won't respond

I have a .asmx web service on SharedHosting server which won't respond in some cases. 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

<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. Probably it's missing some configuration.

No. It is not a problem with your web.config file.
When you upload a new web.config, you cause IIS to reset your application.

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. You need to diagnose what the issue is with the service, the web.config isn't the problem

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

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. To test this theory, open your SQL Profile, and look for "audit logout" several times.

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