How to do debug in Web Services

Hello All,

I learnt new thing ,how to debug in Web Services, earlier i have used log (txt) to see where my services failed,but now I got new way.Hence I would like share this with all of you.... :)

steps - 1) Create a new TestWebservice (File->New Project->ASP.Net Web Service Application)
steps - 2) Create a public new method with [webmethod] attribute say " int return type Calculations method accepting two inputs and a calculations class (note set breakpoint in calculation method )
Services.asmx.cs


Calculations.cs
steps -4) Now run the web services and you will see URL in browser like http://localhost:49623/Service1.asmx
steps -5) Now create a new TestClientWebapplications a new website (File->New Project->WebSite) have a button (btncallWebserices) ,Text=CallWebService and on it click event call the web services ( before that u need to Add a Web References add url above).
steps -6) Set breakpoint on btnclick event method run application and then click on Debug -> Attach Process option and attach process of TestWebServices.

steps -7) now Click on button callwebServices, do f9 , breakpoint will jump into web services method.U can check your web services routine by debugging...



Thanks
Shubhank Upadhyay







Comments

Popular posts from this blog

How to Use Not IN operator

SQL Interview Questions

String Function in SQL-Substring,Reverse,CharIndex