Any example with communicationcomponents ?

I want have communication with an ASP.NET page and NAS. Do you know a better code example that SDK of Navision Attain? I need the both parts (Navision and ASP). Thank you

Hi! Did you get some example? I have some example in C/Side environment, but need some ASP example. That I want to do are connecting from a ASP side thru TCP/IP to ATAS(NAS) and return a XML file with data. I allso need to sens some parameters to ATAS to select what i want to return. Someone tried this?

Hello, I a currently trying to do the same thing. Would you guys mind letting me know what happens in your project so that I can get a feel for what I need to do? I can get the ASP page to send a message to MSMQ and Navision to send a message but then I don’t really know how to set Navision so that it monitors NAS. Any help would be greatly appreciated.

Per Bay I tried emailing you but you were not at your office and your email auto-replied stating so. If you can get some samples soon that would be great. My email address is

Hi Eslee, See codeunit: 6221 - Request Handler, for an example of a queue listener in Navision. Refer to the Commerce Portal Channel readiness kit for documentation. Basically you need to create a (single instance)codeunit that is started by NAS and that listens to a queue and triggers on an event. Navision will not monitor NAS, NAS will monitor MSMQ. /Bruno

Hi Bruno, Where can I get a hold of the “Commerce Portal Channel readiness kit”? I don’t really want to install Commerce Portal. According to Navision, I should be able to do what I set out to do withou installing CP. Though they did mention something about installing the Components of CP. That too has been done. I will look at CU 6221 as reference thanks. [:D] Eslee

Hi have some code written in VB,in the form of MS Access module, and C/AL in navision to make an integration via ComCom,MQ,XML. If u need it, please contact me (yahooid:dargombes135).

Well, I prefer to stay away from using VB. I want to utilize ASP and from an ASP page send an XML stream file to NAS thru MSMQ and ultimately to Navision. I have the ASP page sending a message to MSMQ and I can get Navision to send a message to MSMQ but I am trying to get Navision to respond when a meesage is sent ot a specified Queue. I am aware of the single instant Code Unit and the triggers but still am finding it difficult to integrate everything. Any tips??

Navision responses reflected in the NASHandler function (Codeunit 1).You must specify the startup parameter in NAS. After NAS is started with specific start-up parameter, periodically it will runs a specific routine (usually MQ receieve),that u must build your own. the specific routine example : ComCom::MessageReceived(Var InMsg : Automation) …do something (process the database or reply the message)… that’s the way u have to do in order to integrate something

Hi again, “ComCom::MessageReceived(Var InMsg : Automation)”, is this a line of code or is this a function? When I tried to compile i get an error stating that “The Type ‘Automation’ was not defined for the function”. ComCom is defined as automation ‘Communication Component’. Es,

1st you must define ComCom variables as Navision Communication Component2.CommunicationComponent automation variable, in the variable properties… fill WithEvents properties with ‘Yes’ then you should seen that there’s a function created called ComCom::MessageReceived… What u must do is only type the code what navision should do if there’s a stream accepted by NAS in that events(MessageReceived event).

Ok, I finally understand that portion. Then another question is does NAS only respond to XML messages? I do have messages going into a specific queue and I try having NAS monitor that but nothing happens when I send a message out to that queue. I am however not sending the message in a XML. I’m just trying to figure out y this is not working. I do have the monitoring CU defined as a single instance. I also defined the Communication Commponent.inmessage with the ‘With Events’ option as Yes. Any ideas as to why it would not work? Es,

Eslee, If you are using MSMQ as your communication method then the ComCom automation object must be used with the Navision MSMQ busadaptor automation object. When declared as a variable this will expose properties that enable you to specify the queue name and location that NAS must monitor. The single instance codeunit that you have created above must have variables for both the ComCom and the MSMQBusAdator (GautComCom & GautMSMQBus in my code example below). After both of these have been instanciated (CREATE) you use the OpenRecieveQueue and OpenReplyQueue methods of GautMSMQBus to specify the full queue path and name (note I have used variables in the example below as we store these parameters in a user defined setup table). Then the GautMSMQBusAdaptor and GautComCom are ‘linked’ using the AddBusAdaptor method od GautComCom. After this is done any message arriving on the queue that you specified as your recieve queue will cause the firing of any code you place on the ComCom::MessageReceived… trigger. In most simple example you might want to ignore he actual message and just put message(‘hello world!’) in this trigger but remember if you are running under NAS this will appear in the Event log and not on the screen. I hope this helps. I remember the fun and games I had setting this up for the first time! Regards, Chris. // Attempt to open the target message queue that is monitored // by the Navision Application Server. GautMSMQBus.OpenReceiveQueue(VtxtMSMQPath + VtxtTargetQueueName, 0, 0); // Attempt to open the NAS reply message queue. GautMSMQBus.OpenReplyQueue(VtxtMSMQPath + VtxtResponseQueueName, 0, 0); // Tell the communication component about // the MSMQ Bus Adapter. GautComCom.AddBusAdapter(GautMSMQBus, 1);