Calling Codeunits from other applications

shri_mishri_mi Member Posts: 31
Hello,

Is is possible to call codeunits from other/external applications like PHP, C# etc.? If yes, please let me know how can we call the same.

Thanks in advance,
Sriram
With Warm Regards,
Sriram

Comments

  • smic1983smic1983 Member Posts: 27
    It is possible in Nav 2009, for that you have to publish that code unit in Web Services form. Then you can access that code unit in dotnet application through web service.
  • canadian_baconcanadian_bacon Member Posts: 91
    You can also use NAS for this.
  • garakgarak Member Posts: 3,263
    yes it's possible. For example the NAS or a Client use the NAV Soap Components and "read" a TCP Port. so you can send a command, like a http request, to the IP:Port and the NAS runs this codeunit. In the CU 7700 (ADCS NAS Startup) is an example ...

    Also search the forum for NAS Port

    Regards
    Do you make it right, it works too!
  • shri_mishri_mi Member Posts: 31
    Hi Garak,

    Thanks for your prompt reply. However since I am new to NAV, can you pls send me a codeunit sample to test? Also, I installed NAS, got the service started. But when I checked the Eventviewer, I keep getting Warning messages. Can you pls tell me why this is happening?

    Thanks in advance,
    Sriram
    With Warm Regards,
    Sriram
  • bhalpinbhalpin Member Posts: 309
    What are the warnings?
  • shri_mishri_mi Member Posts: 31
    Hi,

    I am getting the following Warning message.
    "The description for Event ID 20010 from source CAS-LT0599 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. The following information was included with the event: The TCP/IP connection's 'host' is not answering (TCP/IP error ECONNREFUSED)."

    Can you pls let me know why this is happening?

    Regards,
    Sriram
    With Warm Regards,
    Sriram
  • bhalpinbhalpin Member Posts: 309
    The preamble of that warning is normal (better minds than mine might be able to explain all that.) The relevent information is "The TCP/IP connection's 'host' is not answering (TCP/IP error ECONNREFUSED)."

    In the long run, there's no 'magic' in NAS; it is simply a NAV client that can only do what any other client can do. So, when I have a NAS problem, my approach is to 'be' NAS and open the database and run the code under the debugger.

    So, here is what I would do:

    - Log onto the machine NAS is supposed to run on using NAS's credentials. (Remote Desktop is a good way to go if you don't want to disturb a running server.)

    - Run the NAV client and open the database

    - If necessary, modify your code so that you can execute the same code as NAS is supposed to on login.

    - Turn on the debugger and run the code. You should end up with the same error message.

    Now, you have some sort of TCP/IP error which you will have to resolve. But, with your NAV code arranged so that you can test it easily 'by hand', you at least have an easier environment to work/test in.

    Next I would Google the error message - I've found that if I have a problem I'm never the first. I Googled it and found lots of hits - some right here in Mibuso. Here's one:

    viewtopic.php?t=19001

    I haven't read it, but it looks like there's lots of info here and on the web in general.

    Good Luck
Sign In or Register to comment.