How to debug NAV Web Service (not RTC)?

vaxo_jjvaxo_jj Member Posts: 54
edited 2012-05-10 in NAV Three Tier
Hi everyone,
do you know if it is possible (if yes - how) to debug NAV Web Service? that is, I have c# application which calls codeunit 50xxx. I want to set breakpoints, step-into, in that codeunit and see what's happening there (wrong).
Or is there a possibility to see where in code system returned an error (like when NAV debugger is set to Active and you see a place in code where it stopped/encountered an error).

I know how to debug RTC, but this doesn't work with web service (to attach .cs file to a process).

thanks.

Comments

  • kinekine Member Posts: 12,562
    It is working in same way as debugging RTC. There is something wrong if not...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • vaxo_jjvaxo_jj Member Posts: 54
    Hi Kine. Thanks for replying.
    I can't make it work. I have an application open in VS and .cs file of a codeunit which I want to debug. Which one I should attach to which process? I tried to attach .cs file to NAV server but then I cant run an application.
    could you please write an example.

    thanks.
  • JAJJAJ Member Posts: 52
    vaxo_jj wrote:
    Hi Kine. Thanks for replying.
    I can't make it work. I have an application open in VS and .cs file of a codeunit which I want to debug. Which one I should attach to which process? I tried to attach .cs file to NAV server but then I cant run an application.
    could you please write an example.

    thanks.

    Hi, as Kine mentioned, you can debug the same way that RTC.

    I have a post with How To.

    http://albertinonav.blogspot.com.es/201 ... .html#more

    Regards.
  • kinekine Member Posts: 12,562
    Open VS. Open the codeunit cs file, set breakpoint. Attach the debugger to Microsoft.Dynamics.NAV.Server.exe process of the server, to which you are connecting. Be sure,t hat you do not have more running NAV servers on your PC. If you have more, be sure, that you are connecting to the correct process by selecting the correct one by SPID (in Task Manager you can display Command Line for the processes and you can select the correct process than by looking from where it is started). The brakpoint should be full red circle and not empty one. After the function is called, it should stop there. Of course, the problem could be in CU 1 and than the process will not hit your breakpoint in your codeunit, because it will fail before reaching it (it is first creating the connection, thus running the code in CU 1).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • vaxo_jjvaxo_jj Member Posts: 54
    now it works :)
    kine, JAJ thanks a lot.
Sign In or Register to comment.