Skip to Content
0

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

Dec 15, 2016 at 05:34 PM

227

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Harish Mistri Dec 15, 2016 at 11:37 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
BIRENDRA CHATTERJEE Dec 16, 2016 at 05:50 PM
0

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'.

Share
10 |10000 characters needed characters left characters exceeded
Harish Mistri Dec 17, 2016 at 08:16 AM
0

Hi Birendra,

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

regards,

Harish

Share
10 |10000 characters needed characters left characters exceeded