Tuesday, August 2, 2011

Debatching XML message


Charan: hmmm I am in little trouble. I have ax XML message confirming to schema shown below and I want to debatch it so that the size of message can be reduced by splitting it into little chunks but don't know how to do it.


Rohit: You can debatch this message by splitting message based on ResponseRecord. To do this you need to perform 3 steps.

1. Convert the schema to envelope.
2. Create schema for single ResponseRecord
3.Create a receive port using XMLReceive pipeline.

Step1: Convert the schema to envelope by following these steps:
1.1 Set Envelope property to Yes by selecting the <Schema>
 

1.2 Set Body XPath to ResponseRecords as shown below.



Step2: Create schema for single ResponseRecord which would be parse the  debatched records by XMLReceive pipeline.
2.1 Import the batch schema into this schema.



2.2 Set the Data Structure Type of Root Node to ResponseRecord from the imported schema


2.3 Rename the Root node to ResponseRecord and make sure that Target Namespace is Empty


Deploy this solution.

Step3: Create a receive location using the XMLReceive pipeline and send port to test the solution.

Cheers
Rohit Sharma

1 comment:

Steve said...

Hi Rohit,

If the original schema has no target namespace, how can the XSD Import be completed?

Post a Comment