Options

Debugging web services

Cem_KaraerCem_Karaer Member Posts: 281
Hello,

I only want to debug the Dynamics NAV web services. It is impossible to select the web service session in the "Debug Session" form to debug as shown in the screenshot (#1).

rkq7nm5j9my8.jpg

The only way to catch a error raised in the web service seems to debug next but unfortunately it repeatedly catches the errors raised by NAS as shown in the screenshot (#2).

feaqe1sfl3e4.jpg

Because the TryFindNextJobQueueEntry is an try-function, I don't want to change its structure (using IF in the FINDFIRST expression) to supress the error.

Debugging NAS is disabled in the NAV administration page as shown in the screenshot (#3).

u1sjiqqpn292.jpg

I am in desperate situation :( what is the solution?
Cem Karaer @ Pargesoft
Dynamics NAV Developer since 2005

Answers

  • Options
    zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    If you want to debug the webservice only then put the break point on the object you have exposed via webservice.
    Activate the debugger on the Windows client session.
    Send the request via Browser/Client.
    Once the break point will hit it you are able to debug it.

    Hope this helps.
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • Options
    zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • Options
    Cem_KaraerCem_Karaer Member Posts: 281
    Hello Zohaib, thank you for your interest. But it doesn't work. I set necessary breakpoints but the "Debug Next" only breaks at errors created by NAS.
    Cem Karaer @ Pargesoft
    Dynamics NAV Developer since 2005
  • Options
    NixPtNixPt Member Posts: 19
    The debug next work's, go the codeunit/Page put a breakpoint and call the webservice. The #1 Screen is ok just need to be debug next. Make sure is that user that does the call.
  • Options
    kylehardinkylehardin Member Posts: 257
    Debug Next is the only way to debug a web service. The sessions and very fleeting, so you won't see them in time in the session list. That having been said, your best bet is to move web services to its own NAV Service Tier (this is a good idea anyway), and only offer SOAP, ODATA, and Client Services. The Client Services part is required to be able to connect your Dev client to the correct NST for debugging. But not having any pesky users or NAS tasks going will greatly simplify your debugging.
    Kyle Hardin - ArcherPoint
  • Options
    KeinierKeinier Member Posts: 1
    When you are debugging a web service, is so great to disable the NAS tasks, to do this you must:
    1. Open the Microsoft Dynamics NAV Server Console and stop the instance that you need to debug.
    2. Then, edit its settings, go to NAS Service fasttab and erase the field "Startup codeunit". (this will avoid the recurrent message of codeunit 480).
    3. So, Start your Microsoft Dynamics NAV Instance
    4. Open your debug tool, and select Debug Next option on the ribbon.
    5. The web service will be stopping in your breakpoint.

    Important to be careful with the configuration of the instance, any mistake could be fatal.

    Cheers,
Sign In or Register to comment.