XML error.
Roelof
Member Posts: 377
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.
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.
Roelof de Jonghttp://www.wye.com
0
Comments
-
how does the xml document look like? save it to a file and post it here.0
-
-
I'm with Roelof on this trying to get this working. Here's the code we've put together:
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.0 -
change it to this
Outs.WRITE('<NAME>Hello World!</NAME>');
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.0 -
Changing the code to Outs.WRITE('<NAME>Hello World!</NAME>'); gives the error message:
"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>0 -
-
Also, make sure that your messge queue is a non transactional one, the BA doesn't know how to deal with a transactional queue. The BA also does not know how to handle double byte character streams (like unicode).0
-
Thanks for the suggestions DenSter, but yes, have tried it without the space -- still get the unexpected token error. Have also tried the message queue as both a transactional and non-transactional one. No difference (same errors). ](*,)0
-
Then the only suggestion I have is to make sure that both the client and NAS and the database server are installed from the same product cd (uninstall everything and reinstall everything from the same cd). A different buld number can screw things up, even though the BA is not mentioned in the change log.0
-
Yes -- client, NAS, and db server were installed from the same product CD (version 4.0 SP2). I've also tried installing hotfix 272944_intl_i386_zip.exe overtop, without any difference.0
-
Try it without the xml version declaration. It might be the question mark. I copied the following from the http://www.w3.org website (the keepers of the XML standard):
<?xml version="1.0"?><greeting>Hello, world!</greeting>
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:<greeting>Hello, world!</greeting>
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

