Skip to Content

SAP PI - How To Add Extra namespace in Receiver File?

Hi All,

This is my first question after SCN upgraded.

I need to add extra namespaces in receiver file.

Now I am getting namespace in output file like below.

<?xml version="1.0" encoding="UTF-8"?>">

But my client expecting below.

<?xml version="1.0"?>" xsi:schemaLocation="" xmlns="">

Please help me to get expected namespaces.

Thanks In Advance,


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Oct 14, 2016 at 09:45 AM

    Hi Manoj/Raghu/Evgeniy/Ramkumar,

    XMLAnonymizerBean only to remove the namespace or namespace prefix not to add the new namespace to the XML.

    According to SAP help:

    You use this module to anonymize XML elements and attributes by removing namespaces or namespace prefixes from the XML document of the main payload.

    The module scan each namespace and verifying that the namespace exist in the list of accepted namespaces which is specified in the module configuration, if found then adding it to the output otherwise it is not adding it to the output.

    So we cannot add the new namespace using XMLAnonymizerBean.



    Add comment
    10|10000 characters needed characters exceeded

    • Yes, it's a nice "trick" but I wouldn't suggest using it as it's undocumented approach.

      I remember the case when I used java code in my UDF based on fact that ResultList class extends standard ArrayList class.

      And in next version SAP developers change it for their own custom class and my code stopped working.

      Regards, Evgeniy.

  • Oct 14, 2016 at 12:45 AM

    XMLAnonymizerBean is capable of retaining the namespace but i dont think it will add new namespace you may try below blog :



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 13, 2016 at 10:19 PM

    Use AF_Modules/XMLAnonymizerBean module in the receiver channel.

    Parameter name – anonymizer.acceptNamespaces

    Refer the blog

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 14, 2016 at 01:16 AM

    Hi Vishnu!

    You could try with using Manoj's suggestion or use XSL transformation in Operation mapping or in channel using MessageTransformBean.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Raghu!

      I didn't try XMLAnonymizerBean for custom namespace adding so can't be sure if it works this way.

      Using XSL transformation after the main mapping in OM could be the right approach IMHO.

      Regards, Evgeniy.