简体   繁体   English

应用程序挂在 web 服务中

[英]Application hanging in a web service

I have an application that users were complaining that it hangs when the user trys to perform a certain action.我有一个应用程序,用户抱怨它在用户尝试执行某个操作时挂起。 I found it that it is hanging in a web service call.我发现它挂在 web 服务调用中。 The web service is running on a remote server. web 服务正在远程服务器上运行。 I can't figure out how to debug into the web service through VS when the code is on a remote server.当代码在远程服务器上时,我无法弄清楚如何通过 VS 调试到 web 服务。

How do I find out in the web service where exactly the code is hanging?如何在 web 服务中找出代码到底挂在哪里?

If you don't have access to the source of the web service then you're not going to be able to "debug" it.如果您无权访问 web 服务的源代码,那么您将无法“调试”它。 If you want to try to externally debug it then you can create a page that sends various inputs to it (some that should work, some that should error out, etc).如果您想尝试从外部调试它,那么您可以创建一个向其发送各种输入的页面(一些应该可以工作,一些应该出错,等等)。 You can then access this page in a browser that has developer tools (I would recommend Firefox w/ Firebug or Google Chrome) and then look at how long the calls are taking.然后,您可以在具有开发人员工具的浏览器中访问此页面(我建议使用带有 Firebug 或 Google Chrome 的 Firefox),然后查看调用需要多长时间。 Google Chrome will show you how long it took to send the request, how long it waited, how long it took to receive, etc. If it IS the actually web service and you don't have access to it then it would be odd that you were responsible for fixing this issue.谷歌浏览器会告诉你发送请求需要多长时间、等待多长时间、接收需要多长时间等。如果它实际上是 web 服务并且你无权访问它,那么奇怪的是您负责解决此问题。 I have a feeling though, if this is a robust web service, you're going to find that you're either having a networking issue or your sending it some invalid input or something along those lines.不过我有一种感觉,如果这是一个强大的 web 服务,你会发现你要么遇到网络问题,要么向它发送一些无效输入或类似的东西。

If you do have access to the source code then simply run the web service locally and point your local version of the application at the local version of the web service.如果您确实有权访问源代码,则只需在本地运行 web 服务并将您的本地版本的应用程序指向本地版本的 web 服务。 Any breakpoints you put in the web service will hang the application and you will be able to step through it just like you can non-web-service code.您在 web 服务中放置的任何断点都会挂起应用程序,您将能够像非 Web 服务代码一样单步执行它。

In your own code, take a look at what is going on with the web service call.在您自己的代码中,查看 web 服务调用发生了什么。 eg Does it throw a fault?例如,它会引发故障吗? Timeout?暂停? Does it ever return a successful response?它是否会返回成功的响应? If not, are you sending valid data?如果不是,您是否发送有效数据?

If the web service call is successful but just slow, consider how you might make your application appear to be more responsive.如果 web 服务调用成功但速度很慢,请考虑如何使您的应用程序看起来更具响应性。 One possibility is to use Asynchronous Programming .一种可能性是使用异步编程

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

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