Home Page › Forums › BizTalk 2013 & BizTalk 2013 R2 › XML Debatching
- This topic has 3 replies, 1 voice, and was last updated 7 years, 3 months ago by community-content.
-
AuthorPosts
-
-
August 20, 2014 at 10:05 AM #27967
Hello,
I’m wondering whether someone can assist with a task I believe should be quite easy, but has left me with no hair.
Please take this file as an example. As you can see the file has multiple <DESADV> segments. My task is to strip these out and map into individual xml documents.
<?xml version=”1.0″?>
<DESPATCH>
<HEAD>
<FileGen>9902345</FileGen>
<Date>2007120414</Date>
<Type>DESPATCH</Type>
<Version>D96A</Version>
<DESADV>
<ANA>5000000000000</ANA>
<Customer>BIZTALK</Customer>
<Order_Number>PO66883</Order_Number>
<DCL>
<Item>BB0001</Item>
<Description>Please</Description>
<Quantity>55</Quantity>
</DCL>
</DESADV>
<DESADV>
<ANA>5000000000000</ANA>
<Customer>BIZTALK</Customer>
<Order_Number>PO66887</Order_Number>
<DCL>
<Item>BB0001</Item>
<Description>Help</Description>
<Quantity>66</Quantity>
</DCL>
</DESADV>
<DESADV>
<ANA>5000000000000</ANA>
<Customer>BIZTALK</Customer>
<Order_Number>PO66883</Order_Number>
<DCL>
<Item>BB0044</Item>
<Description>Me</Description>
<Quantity>77</Quantity>
</DCL>
</DESADV>
</HEAD>
</DESPATCH>As you can see the file has multiple <DESADV> segments. My task is to strip these out and map into individual xml documents.
Say for example, in my send location 3 files would be produced with the following format.
<?xml version=”1.0″?>
<Header>
<ANA>5000000000000</ANA>
<Customer>BIZTALK</Customer>
<Order_Number>PO66883</Order_Number>
<Lines>
<Item>BB0044</Item>
<Description>Me</Description>
<Quantity>77</Quantity>
</Lines>
</Header>Prevously I have been able to complete this by creating an Envelope schema and setting the Body XPath on the HEAD node. But with the above example this fails to work, I believe this is due to the fields that appear after the HEAD node (FileGen/Date/Type) as so on. As I keep getting errors relating to these fields and no schema deployed with in BizTalk.
I have trawled of the internet and all examples for Enveloping appear to show documents with the following structure.
<Record>
<Orders>
<Order>
</Order>
</Orders>
</Record>
I’ve even read that the is possible by creating a custom receive pipeline and using the XML Disassembler option. But after reading on the web using these option only validates the contents of the files against a schema already deployed, it does not actually split the contents.
I hoping someone will be able to assist, as these has rattled me brains for nearly 2 days.
Thanks in advance
-
August 21, 2014 at 10:25 AM #28022
Hi. How to do EDI batching in Biztalk server 2013.
-
August 21, 2014 at 10:44 AM #28043
-
August 21, 2014 at 8:53 PM #28055
Hi,
If you cannot have the sender remove those extra elements under the Head node before the file goes to BizTalk for processing, I would suggest you build a custom pipeline component in the Disassemble stage (of the receive pipeline) to strip those elements off before the message is debatched.
See the following blog for more information on how to go about building such a component:
blogs.msdn.com/…/how-to-develop-biztalk-custom-pipeline-components-part1.aspx
Good luck.
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2013 & BizTalk 2013 R2’ is closed to new topics and replies.