Hi,
I need help on a weird error.
We are trying to drop a message in the MS-MessageQueue. We are using the automations: Microsoft XML v4.0.DomDocument,Navision MS-Message Queue Bus addapter and Navision Communication Component version 2.CommunicationComponent.
When we write to the MS-MessageQueue, we receive the following error:
'The data at the root level is invalid. Line 1 position 1.
Any help is welcome.
Thanks.
0
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
RIS Plus, LLC
CREATE(MQBus);
CREATE(CC2);
CC2.AddBusAdapter(MQBus,1);
MQBus.OpenWriteQueue('kiosk1\comcom2_queue',0,0);
MQBus.SenderAuthenticationLevel := 2;
OutMsg := CC2.CreateoutMessage('Message [url=queue://kiosk1]queue://kiosk1[/url]\RMS-requests');
Outs := OutMsg.GetStream;
//Outs.WRITE('Hello World!');
Outs.WRITE('<?xml version="1.0"> <NAME>Hello World!</NAME>');
OutMsg.Send(0);
It occured to me that perhaps the reason Roelof was getting his error message is because the text he was trying to send wasn't in XML format, so I commented-out the text and attempted to change it to XML. However, now I'm getting the following error:
"This is an unexpected token. The expected token is 'NAME'. Line 1, position 20."
Is there a way to see exactly what format the message queue is expecting its in-stream data?
Thanks for the help on this guys.
This should work.
To verify that you xml document is correct. save it in a text file with .xml extension and open it in internet explorer. If it doesn't open, then you have a problem. If it does you are good to go.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
"Cannot deserialize the message passed as an argument. Cannot recognize the serialization format."
Saving <NAME>Hello World!</NAME> to a text file called test.xml and opening it with Internet Explorer displays the text:
<NAME>Hello World!</NAME>
RIS Plus, LLC
RIS Plus, LLC
RIS Plus, LLC
Notice that in your example, you only have a question mark before the xml declaration. You should have one at the end of the declaration as well. It should also work (Like Ara3n suggests) without the declaration, so that would be this:
RIS Plus, LLC