MSMQ OpenReplyQueue

gkservicegkservice Member Posts: 9
we have problems sending correct replys to a Messagequeue
The Errormessage is:
This message is for C/AL programmers:

The call to member Send failed. MSMQBusAdapter.MSMQBusAdapter.1 returned the following message:
The queue given could not be used to write messages. Check access rights, validity and settings.

our code simply is the following
OBJECT Codeunit 50020 RunNavisionProcess
{
  OBJECT-PROPERTIES
  {
    Date=28.09.12;
    Time=16:41:02;
    Modified=Yes;
    Version List=NAVW15.00,NAVDACH4.00;
  }
  PROPERTIES
  {
    SingleInstance=Yes;
    OnRun=BEGIN
            IF ISCLEAR(ComCom) THEN
              IF NOT CREATE(ComCom) THEN
                ERROR(Text001);
            IF ISCLEAR(MSMQ_BA) THEN
              IF NOT CREATE(MSMQ_BA) THEN
                ERROR(Text001);

            ComCom.AddBusAdapter(MSMQ_BA,1);
            MSMQ_BA.OpenReceiveQueue('.\private$\mqtonavision',0,0);
            MSMQ_BA.OpenReplyQueue('.\private$\mqfromnavision',0,0);
          END;

  }
  CODE
  {
    VAR
      ComCom@1450001 : Automation "{F9A57667-8AC5-45C5-9416-99D3955BCAC0} 1.0:{01018FA5-E4B4-413C-A47C-AD34B0CC2647}:'Navision Communication Component version 2'.CommunicationComponent" WITHEVENTS;
      MSMQ_BA@1450000 : Automation "{B8BD635A-E191-47EF-84A0-02921E2A44A6} 1.0:{CD49794B-0E84-4A2E-9522-C518C825D390}:'Navision MS-Message Queue Bus Adapter'.MSMQBusAdapter";
      Text001@1450003 : TextConst 'ENU=Cannot create communication components.';

    LOCAL PROCEDURE WriteToQueue@1240002(OutMsg@1450002 : Automation "{F9A57667-8AC5-45C5-9416-99D3955BCAC0} 1.0:{6CB9762C-E61C-4F96-BA34-8B20D3A5B46E}:'Navision Communication Component version 2'.OutMessage";XMLDoc@1450000 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 3.0:{F6D90F11-9C73-11D3-B32E-00C04F990BB4}:'Microsoft XML, v3.0'.DOMDocument");
    VAR
      OutStreamQueue@1450001 : OutStream;
    BEGIN
      OutStreamQueue := OutMsg.GetStream();
      XMLDoc.save(OutStreamQueue);
      OutMsg.Send(0);
      CLEAR(OutMsg);
    END;

    EVENT ComCom@1450001::MessageReceived@1(VAR InMessage@1450000 : Automation ":{00020400-0000-0000-C000-000000000046}:''.IDISPATCH");
    VAR
      Company@1450012 : Record 2000000006;
      SalesHeader@1450010 : Record 36;
      InMsg@1450003 : Automation "{F9A57667-8AC5-45C5-9416-99D3955BCAC0} 1.0:{D184D0AC-61C9-4AC1-B537-0D28C277FEDE}:'Navision Communication Component version 2'.InMessage";
      XMLDoc@1450006 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 3.0:{F6D90F11-9C73-11D3-B32E-00C04F990BB4}:'Microsoft XML, v3.0'.DOMDocument";
      XMLNode@1450005 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 3.0:{2933BF80-7B36-11D2-B20E-00C04F983E60}:'Microsoft XML, v3.0'.IXMLDOMNode";
      XMLDOMMgmt@1450001 : Codeunit 99008516;
      InStreamQueue@1450002 : InStream;
      XMLChar@1450007 : Text[1];
      XMLText@1450004 : Text[1024];
      UserName@1450014 : Text[1024];
      CompanyName@1450013 : Text[1024];
      FunctionName@1450008 : Text[1024];
      ParameterList@1450009 : Text[1024];
      DocumentType@1450011 : Option;
      BizNAS@1140000 : Codeunit 50062;
    BEGIN
      InMsg := InMessage;
      InStreamQueue := InMsg.GetStream();
      REPEAT
        InStreamQueue.READTEXT(XMLChar);
        XMLText := XMLText + XMLChar;
      UNTIL InStreamQueue.EOS;

      CREATE(XMLDoc);
      XMLDoc.loadXML(XMLText);
      BizNAS.GetAssets(XMLDoc, 'I.12-1895');
      WriteToQueue(InMsg.CreateReply,XMLDoc);
      InMsg.CommitMessage;
      CLEAR(InMsg);
    END;

    BEGIN
    END.
  }
}

I searched already for several days but :-( ...no sucess
The queue itself is without any authentication.

Does someone have a Idea why I can not see my fault?
Sign In or Register to comment.