Skip to Content
avatar image
Former Member

How to remove namespace prefix for selected nodes/fields in PI before submitting to WSDL

Dear Experts,

I want to remove additional namespace for selected fields in PI before submitting to WSDL. Kindly note there is no possibility of changing the the 'WSDL Schema' imported in external definition.

Please suggest whether this can be done by using 'Anonymizer Bean' in Receiver Communication Channel or by writing any UDF in Message Mapping. If not possible by these means, whether this can be done by XSLT Tool. I have searched some blogs but did not find one where it guides us to selectively remove the namespace of nodes/fields.

I have provided the scenario below. Waiting for your expert advice, a step-by-step guide would be really helpful. Thanks in advance.

Current XML Output

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

http://www.xyz.com">

<ns1:field1>1</ns1:field1>

<ns1:field2>2</ns1:field2>

<ns1:field3>2</ns1:field3>

<ns1:field4>

<ns1:subfield4>4-1</ns1:subfield4>

</ns1:field4>

</ns1:Submit>

Required XML Output

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

http://www.xyz.com">

<ns1:field1>1</ns1:field1>

<ns1:field2>2</ns1:field2>

<ns1:field3>2</ns1:field3>

<field4>

<subfield4>4-1</subfield4>

</field4>

</ns1:Submit>

Thanks and Best Regards,

Birendra Chatterjee

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 15, 2016 at 11:37 PM

    Hi Birendra,

    You can write the java code in message mapping function "Attribute and Methods" to replace the xml prefix of specific nodes with required output. Please refer the below blog for reference

    https://blogs.sap.com/2013/03/13/write-java-mapping-directly-in-esr/

    regards,

    Harish

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 16, 2016 at 05:50 PM

    Thanks Harish for the very useful blog reference.

    I was able to achieve the desired output, by writing java code in message mapping function 'Attribute and Methods'.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 17, 2016 at 08:16 AM

    Hi Birendra,

    Good to hear that your problem is resolved. Please close the discussion.

    regards,

    Harish

    Add comment
    10|10000 characters needed characters exceeded