CPHandler doc or example

fufikkfufikk Member Posts: 104
edited 2006-09-20 in Navision e-Commerce
Hi,

could you tell me where can I find documentation for using CpHandler for MSMQ?

or provide me with a short example how to send/receive a message?

thanks,

Comments

  • ara3nara3n Member Posts: 9,256
    Take a look at Cu 7700 ADCS NAS Startup. It uses MSMQ
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • fufikkfufikk Member Posts: 104
    Yep, but it uses Communication Component and Msmq bus adapter. I am particulary interested in CPHandler functions: SendToLabel etc...
  • ara3nara3n Member Posts: 9,256
    I C take a look at cu 6221 Request Handler
    XMLDocumentRecv.ParseXMLDocument(XMLDocIn,XMLDocOut,ProcessType);
    QueueHandler.SendToLabel(NASMgt.GetReqOutQueue,XMLDocOut,QueuePriority,NASMgt.GetReplyTimeOut,NASMgt.GetHKEYLOCALMACHINEReq,FALSE)
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • fufikkfufikk Member Posts: 104
    Yep, I've seen that - the only problem is, that my computer doesn't have the registry keys that are in settings, thus I don't know what is supposed to be there...
  • ara3nara3n Member Posts: 9,256
    Could you explain what your problem is? You don't have Registry keys?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • fufikkfufikk Member Posts: 104
    Yep, pretty much. I don't know what should be there - what keys and what values.
    I could also use a small sample of how to send and receive a message - somehow google doesn't show much it this subject.

    And a general question - how is CPHandler better than ComCom2 + MSMQBusAdaper? more efficient?...
  • ara3nara3n Member Posts: 9,256
    Commerce portal is being discontinued. So it doesn't make sense to use it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DduranDduran Member Posts: 22
    Hi,

    i'm using cphandler for interchange xml documents between Navision and other applications and it works fine.

    It has one restriction, you must use cphandler in both sides. In exah machine you have define the registry keys.

    With ComCom2 + MSMQBusAdaper i have problems wirh spanish spcial characters.

    I give you an example:

    v_pathregistro:='SOFTWARE\Navision\Navision_Infoges\'; //Path in the registry key
    v_claveregistro:='Receive_queue';

    //Registro windows is the automation 'Windows Script Host Object Model'.WshShell

    v_colarecibir:=RegistroWindows.RegRead(('HKEY_LOCAL_MACHINE\'+v_pathregistro+v_claveregistro);

    IF NOT queuehandler.ListenToLabel(v_claveregistro, v_pathregistro) THEN
    ERROR('Can´t read');

    You have define the cphandler automation with "with events" property and the system creates the event MessageReceived. This event occurs when a new message is received.

    The codeunit whe you define this automation must have the "single instance" propertie with yes value.

    To send a message is easier, you only need the name of the destination queue and a xml message and use the send to label method.

    Regards, David.
  • DenSterDenSter Member Posts: 8,307
    Even better is to program with the MSMQ object model directly. That way you can use VB or C# code samples to construct code in NAV.
  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from Navision forum to Navision e-Commerce forum]\
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • fufikkfufikk Member Posts: 104
    Ok, I'll try your solutions.

    In Polish we also have some special chars, but when I use MSMQ Bus + XMLports (which encode data for example in UTF-8) I didn't have problems with special chars.
Sign In or Register to comment.