Skip to Content

XML generated with different prefix for the same namespace

Hello!

We have a standard WS in two systems that have different SAP version.

We have a custom program to generate a XML with a transformation. (same code in both systems)

In the system with the latest sap version the XML is generated like this:

And in the old one:

As you can see these three nodes are generated with same namespace but the last one has different prefix only in the old system.

---

This is a problem because another standard program is expecting this three nodes with the same prefix. And it's returning an error in the old system only.

Code copied from the standard report:

    CONCATENATE 
mv_header_ns_prefix ':Cabecera/'                 
mv_header_ns_prefix ':Titular/'                 
mv_header_ns_prefix ':NIF'                 
INTO iv_value_name.

"... it's looking for a node like this "n1:Cabecera/n1:Titular/n1:NIF"

lo_xml->parse_xstring( EXPORTING stream = iv_xml ).
lo_xml->find_node( EXPORTING name = iv_value_name
                           RECEIVING node = lo_node ).

---

Do you know if we can do something to generate the XML properly?

I dont have much experience with WS so any clue would be appreciated.

Thanks in advance.

Regards.

new.jpg (84.7 kB)
old.jpg (159.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 18 at 06:12 AM

    First of all, it's not an invalid XML (just a non-optimized one, etc.), but it's your "standard program" which is limited. Why do you say "standard"? If "standard" means that SAP developed it, then ask them to correct it.

    Add comment
    10|10000 characters needed characters exceeded