Importing XML into NAV2009

Hi Everyone,

I need to import an XML into 2 new tables in NAV 2009.
The XML is like this:

<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<SalesInvoices xmlns="urn:microsoft-dynamics-nav/xmlports/ExportSalesInvoices">
  <SalesInvoice>
    <InvoiceNo>2021-29037</InvoiceNo>
    <NIF>A48000186</NIF>
    <CustNo>000010</CustNo>
    <CustName>AGUAS DE ASUA, S.L.</CustName>
    <ExtDocNo>JAIME CORTINA</ExtDocNo>
    <DocDate>26/08/21</DocDate>
    <PostingDate>26/08/21</PostingDate>
    <VATEntry>
      <Country>ES</Country>
      <VATBusPostingGroup>NAC</VATBusPostingGroup>
      <VATProdPostingGroup>CV21</VATProdPostingGroup>
      <GenBusPostingGroup>NAC</GenBusPostingGroup>
      <GenProdPostingGroup>SERVICIOS</GenProdPostingGroup>
      <Base>-1.152,00</Base>
      <VAT>21,00</VAT>
      <EC>0,00</EC>
      <Amount>-241,92</Amount>
    </VATEntry>
    <VATEntry>
      <Country>ES</Country>
      <VATBusPostingGroup>NAC</VATBusPostingGroup>
      <VATProdPostingGroup>CV21</VATProdPostingGroup>
      <GenBusPostingGroup>NAC</GenBusPostingGroup>
      <GenProdPostingGroup>SERVICIOS</GenProdPostingGroup>
      <Base>-0,04</Base>
      <VAT>21,00</VAT>
      <EC>0,00</EC>
      <Amount>0,00</Amount>
    </VATEntry>
    <VATEntry>
      <Country>ES</Country>
      <VATBusPostingGroup>NAC</VATBusPostingGroup>
      <VATProdPostingGroup>CV21</VATProdPostingGroup>
      <GenBusPostingGroup>NAC</GenBusPostingGroup>
      <GenProdPostingGroup>MERCADERIA</GenProdPostingGroup>
      <Base>-452,46</Base>
      <VAT>21,00</VAT>
      <EC>0,00</EC>
      <Amount>-95,03</Amount>
    </VATEntry>
  </SalesInvoice>
</SalesInvoices>

The XMLport I use to import, is this:

And I’m importing with this function:


I’m getting this error:

imagen
I’ve worked in NAV2009 importing XMLs, but always using the XMLport has a parameter in a function published as WS. In this case, I’m exportin an XML in a Business Central, and I need to import it in NAV2009, and this was the easiest way in my opinion, but I don’t know…

Seems some Issue on the structure of the XmlPort, Try changing the SalesInvoice to Attribute and see, In your XML it’s an Attribute.

FIrst of all thank for your answer @RockWith . Where can you see that SalesInvoice in the XML it’s an attribute? I’ve defined the exporting XMLPort this way…

Seems that if I generate the XML without namespace, work correctly