cancel
Showing results for 
Search instead for 
Did you mean: 

Target Xml

Former Member
0 Kudos

Hello every one,

I have just done a file to file Scenario

Actually the requirement is my trading partner want target xml like shown below

<?xml version="1.0" ?>

- <ACKNOWLEDGE_DELIVERY_001>

- <CNTROLAREA>

- <BSR>

<VERB value="ACKNOWLEDGE">ACKNOWLEDGE</VERB>

<NOUN value="DELIVERY">DELIVERY</NOUN>

<REVISION value="001">001</REVISION>

</BSR>

But for me after i have done the whole scenario it is comming like shown below

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

- <ns0:MT_Ack_Delivery_Inbound xmlns:ns0="urn:commscope.com/ALUespares/AckDelivery">

- <ACKNOWLEDGE_DELIVERY_001>

- <CNTROLAREA>

- <BSR>

<VERB value="ACKNOWLEDGE">ACKNOWLEDGE</VERB>

<NOUN value="DELIVERY">DELIVERY</NOUN>

<REVISION value="001">001</REVISION>

</BSR>

You might have noticed the difference between the two xml

The Message Type and Name Space part as shown below should not come according to requirement

- <ns0:MT_Ack_Delivery_Inbound xmlns:ns0="urn:commscope.com/ALUespares/AckDelivery">

Can any one please help me ho can i do that

Regards

Swetha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Swetha,

Try this

1. since your XSD is not big, define a data type with the name ACKNOWLEDGE_DELIVERY_001. when you define with this name then you will have the top element as ACKNOWLEDGE_DELIVERY_001 and then define all the elments below as per the XSD.

2. Define the message type. You can remove the XML namespace under the MT

3. use XML anonymizer bean in the receiver file adapter to remove the name space. under the module tab add as below

AF_Modules/XMLAnonymizerBean Local Enterprise Bean 0

ModuleKey : 0

Parameter Name: anonymizer.acceptNamespaces

Parameter value: Leave it blank

It works for me . Give a try and let me know.

Thanks,

Srini

Former Member
0 Kudos

Hi Swetha,

1. since your XSD is not big, define a data type with the name ACKNOWLEDGE_DELIVERY_001. when you define with this name then you will have the top element as ACKNOWLEDGE_DELIVERY_001 and then define all the elments below as per the XSD.

2. Define the message type. You can remove the XML namespace under the MT

3. use XML anonymizer bean in the receiver file adapter to remove the name space. under the module tab add as below

AF_Modules/XMLAnonymizerBean Local Enterprise Bean 0

ModuleKey : 0

Parameter Name: anonymizer.acceptNamespaces

Parameter value: Leave it blank

Hello Srinivas, thanks very much for your help, but i have got a small doubt while using XML anonymizer bean in the receiver file adapter, where exactly i have to add the below query.

AF_Modules/XMLAnonymizerBean Local Enterprise Bean 0

, I am using 7.1 version

Former Member
0 Kudos

Add it in your Receiver communication channel - Module

Check this blog for help

Former Member
0 Kudos

I have used XML anonymizer bean in the receiver file adapter to remove the name space. under the module tab add as below but its not working

The receiver communication channel is not picking the message at all.

AF_Modules/XMLAnonymizerBean Local Enterprise Bean 0

ModuleKey : 0

Parameter Name: anonymizer.acceptNamespaces

Parameter value: Leave it blank

Former Member
0 Kudos

Hi Swetha,

Please check Whether you have Anonymiserbean in first place of processing sequence tab..

The order shoudl be

Anonymiser Bean

Call Sap Adapter

Check this point and then let us know.

Former Member
0 Kudos

Hello Srini, that solved the problem

Thanks very much

Former Member
0 Kudos

Hello Kiran,

You were right, i have placed it wrong way

Thanks for your help

Former Member
0 Kudos

Great that you have solved the problem.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Use the XSLT code in below link to remove namespaces.

http://sap-pi7.blogspot.com/2011/03/generic-xslt-code-to-remove-namespaces.html

-santosh.

Former Member
0 Kudos

Hello Santhosh,

I have already done my message mapping and every thing i cant go back to xslt mapping now, More over i have no idea where this code has to be used exactly.

Can you please explain me

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

<?xml version="1.0" ?>

- <ACKNOWLEDGE_DELIVERY_001>

- <CNTROLAREA>

- <BSR>

<VERB value="ACKNOWLEDGE">ACKNOWLEDGE</VERB>

<NOUN value="DELIVERY">DELIVERY</NOUN>

<REVISION value="001">001</REVISION>

</BSR>

This is not a valid XML (no root message) Tell this to the third-party.

Hope this helps,

Mark

Edited by: Mark Dihiansan on Jan 6, 2012 2:16 AM

Edited by: Mark Dihiansan on Jan 6, 2012 2:33 AM