using cphandler

DduranDduran Member Posts: 22
I'm using the cphandler dll to communicate two applications using xml documents througth msmq service. The first one using .net and the second one with dynamics Nav 4.0 sp2. If in the first one we dont use this dll to send the message then, then message arrive and its readed but then event cphandler::messagerecieved is not activated.

I´ve tried with Navision communication component -->cphandler with the same results.




Sorry for my english..... :oops:

Comments

  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
    [Topic moved from Dynamics NAV to Navision forum]
  • DenSterDenSter Member Posts: 8,307
    Find a help file called devguide.chm on your product CD. This file will explain how to use the communication component and MSMQ. You're looking for the MQBusadapter, not the CPHandler. I couldn't get the CP one to work either, but the BA is quite easy to program.
  • DduranDduran Member Posts: 22
    Hi denster,

    we have tried the Navision comunication component with the mqbusadapter and found problems with spanish special characters that cut the message, that with cphandler dont occurs.

    We suppose that this dll is listening for messages and when one arrive the event "message_received" is activated, but thet not occurs. The message dissapear from the queue but the event is not activated.

    We´ve resolved the problem using cphandler in both sides but we want know why?

    Thanks.
  • IHateLinuxIHateLinux Member Posts: 223
    Hi,

    two questions:

    1.) Have you set the property "WithEvents" on your Automation variable?
    2.) Is the codeunit running as "Single Instance" == True ?

    HTH,

    Rainer
  • DenSterDenSter Member Posts: 8,307
    it's because of double byte characters. I used to have a ink to how this works internally, but can't find it. Basically, single byte characters are represented by a pair of bits, and double byte characters are represented by two pairs of bits. For single a byte character to be represented by a double byte character, you need to have a value in the second bit pair, and it was decided that the pair '00' would be the "filler" for these characters. So if the single byte character is '12', then the double byte character for the same character would be '12 00'.

    The problem with this is that a single byte character stream's EOS character is the bit pair '00'. So if you work with a component that can only understand single byte characters (like the Navision MSMQ Bus Adapter), it sees the '00' and then thinks it is EOS, and it will stop processing. Because the component has some serious limitations (there's no error feedback, the message just disappears), it is really difficult to figure out what is going on.

    I may be incorrect on parts of this, because I only understand it halfway, but it is because of the double byte EOS bit pair that the BA fails. I've solved it by programming a MSMQ monitor by using the object model directly, but it now appears that the CPhandler can handle those characters also.
Sign In or Register to comment.