简体   繁体   中英

How can I debug a web service called asynchronously from javascript?

I have a ASP.NET web service that I used to asynchronously save data to my database. I have a button on my webpage that invokes a javascript method which looks through the dom, gathers the data and sends it off to the service.

I'm debugging a problem right now that I believe is happening in this web service, and I would like to debug the web service when it gets invoked, but I'm not sure if this can be done, and if so how?

Something very strange is going on in that service, so I'd like to be able to step through it and figure out where the problem is occurring.

You will need to attach the debugger to the process hosting the web service. This would be aspnet_wp in IIS 5, w3wp in IIS 6 or 7, or could be the Visual Studio Development Server if it's running in the same solution.

Once the debugger is attached, simply open the source of the service and set breakpoints. If you're attached to the correct process, then the breakpoints will appear as filled-in circles; if not, they'll be hollow circles with a warning icon. Hover over the icon to see what the problem is.

Have you tried placing a breakpoint in the codebehind in the web service? It works fine for me... but maybe I'm missing something.

Firebug was made for exactly this task http://getfirebug.com/ on the client side.

On the server side, use standard tools (debuggers, loggers ...)

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