on 06-08-2010 8:10 AM
Hi all
I have a file which looks like this
HDD 9800000660980000061911062009AA123456bbWM100012349800000619
DDD_TEST001 4012YAG1
WZOA00000000010000000001
WZOA00000000020000000002
IAAXX000001
IAAXX000002
C0000000000000000000100000000000000000001000000000000000000020000000000000000000300000000000000000004
T2
and my structure is
Header - 1
Detail - 0....Unbounded
Bag - 0.....Unbounded (sub node of detail)
Track - 0.....Unbounded (sub node of detail)
Customer - 0.....Unbounded (sub node of detail)
Trailer - 1
and in the file sender adapter i mentioned the following content conversion setting
HEADER,1,DETAIL,*,Bag,*,Track,*,Customer,*,TRAILER,*
But when i go and see in the monitoring i received the following conversion where BAG, TRACK and CUSTOMER nodes are outside detail.
<?xml version="1.0" encoding="utf-8" ?>
<ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
<HEADER>
</HEADER>
<DETAIL>
<ID>D</ID>
<count/>
</DETAIL>
<Bag>
<ID>W</ID>
<Zone>ZOA</Zone>
</Bag>
<Bag>
<ID>W</ID>
<Zone>ZOA</Zone>
</Bag>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Track>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Track>
<Customer>
<ID>C</ID>
<OrigCustomer>00000000000000000001</OrigCustomer>
<Field1>00000000000000000001</Field1>
</Customer>
<TRAILER>
<ID>T</ID>
<Count>2</Count>
</TRAILER>
</ns:MT_REQ>
whereas i wanted bag, track and customer to be inside detail along with details data:
<?xml version="1.0" encoding="utf-8" ?>
<ns:MT_REQ xmlns:ns="http://royalmail.com/dd_c">
<HEADER>
</HEADER>
<DETAIL>
<ID>D</ID>
<count/>
<Mixed />
<Bag>
<ID>W</ID>
<Zone>zzz</Zone>
</Bag>
<Bag>
<ID>W</ID>
<Zone>zzz</Zone>
</Bag>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Track>
<Track>
<ID>I</ID>
<Item>AAXX000001</Item>
</Track>
<Customer>
<ID>C</ID>
<OrigCustomer>00000000000000000001</OrigCustomer>
<Field1>00000000000000000001</Field1>
</Customer>
</DETAIL>
<TRAILER>
<ID>T</ID>
<Count>2</Count>
</TRAILER>
</ns:MT_REQ>
i.e. i need all Bag ,Track and Customer inside detail tag.
could anyone help me in this..i've already searched SDN and got some link as useful but none of them were totally related.
Regards
Naina
Maybe my blog will help you.
/people/peng.shen2/blog/2010/03/11/pixi-file-content-conversion-for-a-complex-structure
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> whereas i wanted bag, track and customer to be inside detail along with details data:
This is not possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
naina,
ideally such scenarios are handled via a custom java or XSLT mapping.
Here you will read the file and convert it to an XML without hierarchy, then a java/xslt mapping will be used to build the following logic.
Another option would be to use tools like conversion agent and then do the XML conversion
/people/shabarish.vijayakumar/blog/2007/03/21/conversion-agent--silence-of-the-repeatinggroup-part-1
/people/shabarish.vijayakumar/blog/2007/03/21/conversion-agent--silence-of-the-repeatinggroup-part-2
Hi
cannot use Conversion Agent in my project
Can i make a User defined function between <Bag> on left and <Bag> on right and add some flag in a field of right side <Bag> so that when IDOC generates in CRM, they can see the flag and relate to which Detail it belonged to.
Or
Is there any way out to change the structure of xml dynamically so that i can map it to IDOC on right side correctly
Please suggest something guys
Regards
Naina
Hi all
One more question ....how to use two message mappings in a singe interface mapping and why do we use them ??
Can i use it in my scenario so that i make a java mapping first in which i convert the source structure to desired target structure and then make a second message mapping in which i map the new made structure to the IDOC on the target side
Naina
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.