Hi, i’m developing some webservices that communicate with Navision through MSMQ, i’ve established communication, the services are working just fine, but know i want to handle errors that occur in Navision and send them back to the webservice, for that, according with the documentation (cd drive\Client\Common\Navision\Communication Component\devguide.chm) Navision creates a message, NavisionErrorMsg with the description of the error. But it seems that’s something wrong with the xml that Navision generates, when i try to read the xml in the webService, it returns me a XMLException, and says that the XML Root Element is missing. Here is the message that im getting FF FE 3C 00 3F 00 78 00 6D ÿþ<.?.x.m 00 6C 00 20 00 76 00 65 00 .l. .v.e. 72 00 73 00 69 00 6F 00 6E r.s.i.o.n 00 3D 00 22 00 31 00 2E 00 .=.".1… 30 00 22 00 3F 00 3E 00 3C 0.".?.>.< 00 4E 00 61 00 76 00 69 00 .N.a.v.i. 73 00 69 00 6F 00 6E 00 45 s.i.o.n.E 00 72 00 72 00 6F 00 72 00 .r.r.o.r. 4D 00 73 00 67 00 20 00 78 M.s.g. .x 00 6D 00 6C 00 6E 00 73 00 .m.l.n.s. 3D 00 22 00 75 00 72 00 6E =.".u.r.n 00 3A 00 77 00 77 00 77 00 .:.w.w.w. 2D 00 4E 00 61 00 76 00 69 -.N.a.v.i 00 73 00 69 00 6F 00 6E 00 .s.i.o.n. 2D 00 63 00 6F 00 6D 00 3A -.c.o.m.: 00 4E 00 61 00 76 00 69 00 .N.a.v.i. 73 00 69 00 6F 00 6E 00 45 s.i.o.n.E 00 72 00 72 00 6F 00 72 00 .r.r.o.r. 4D 00 73 00 67 00 2E 00 78 M.s.g…x 00 6D 00 6C 00 22 00 3E 00 .m.l.".>. 3C 00 45 00 72 00 72 00 6F <.E.r.r.o 00 72 00 4E 00 6F 00 3C 00 .r.N.o.<. 45 00 72 00 72 00 6F 00 72 E.r.r.o.r 00 4D 00 65 00 73 00 73 00 .M.e.s.s. 61 00 67 00 65 00 3E 00 4C a.g.e.>.L 00 6F 00 63 00 61 00 6C 00 .o.c.a.l. 69 00 7A 00 61 00 E7 00 E3 i.z.a.ç.ã 00 6F 00 20 00 43 00 F3 00 .o. .C.ó. 64 00 69 00 67 00 6F 00 d.i.g.o. I think the problem is the xml, can anyone help? Thnks, rjnc
I have not worked with that message, but what I would try is to load it into a MSDOM object and save it as a file (MSDOM.Save(C:\SomeFolder)), so you can take a look at it. If the parser says ‘root element missing’, ten to one says you are missing the root element :). Instead of just sending in the message, you will probably have to put the message into a properly formatted XML document before sending it off.
Thnks for the reply, but i dont think its possible, when the error occurs Navision stops the execution and it generates and responds automaticaly, so i cant save the message that he is sending. I only want to use this message to handle errors that might occur in Navision, is any other way of handling errors on Navision so i can get the error, build the xml message and return it to the web service? Thnks again, rjnc