Error XML Import NAV2009

polmannpolmann Member Posts: 18
Hi i’m trying to create an XMLPort to import an XML file. The format looks something like the code below. If i remove the xmlns tags and the com: in front of the ID, the import works fine. Is there a way to make the import work without removing these tags/prefix? I get the following error message when i try to import the file.

Microsoft Dynamics NAV Classic
The XML Parser setup fails.
Error = c00cee65 Code meaning = Unknown error 0xC00CEE65

OK


<?xml version="1.0" encoding="UTF-8" ?>
- <Invoice xmlns="http://rep.oio.dk/ubl/xml/schemas/0p71/pie/&quot; xmlns:com="http://rep.oio.dk/ubl/xml/schemas/0p71/common/&quot; xmlns:main="http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/&quot; xmlns:xsi="http://rep.oio.dk/ubl/xml/schemas/0p71/XMLSchema-instance"&gt;
<com:ID>123456789</com:ID>
</Invoice>

/Polmann

Answers

  • kinekine Member Posts: 12,562
    You can try to play with UseDefaultNamespace and DefaultNamespace properties of the XMLPort,may be it will somehow help...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jlandeenjlandeen Member Posts: 524
    I've seen this problem with XML data being sent to NAV and it doesn't handle/work with namespaces very well or easily.

    The simplest approach that I've found works well with NAV is to remove the namespace from an incomming XML document before sending the stream to the XML Port. You can find an example here http://www.mibuso.com/forum/viewtopic.php?f=23&t=14637&hilit=xml+namespace where there is a function that removes the namespace.

    I haven't played with the DefaultNamespace properties and I'm not sure if they work on Input or Export XML ports - but removing the namespace should definately help.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • ara3nara3n Member Posts: 9,256
    The issue with defaultNamespace is that it can handle only one. XMLPort assign the tag to each tag element.
    It cannnot handle mulitple namespaces.

    Follow jlandeen advise and use the function to remove all namespaces before loading the xml file.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • polmannpolmann Member Posts: 18
    Thanks for the answers. I think that i will use the function to remove all namespaces, and then do the import.
    :D
Sign In or Register to comment.