Home Page › Forums › BizTalk 2004 – BizTalk 2010 › saving complete XML in XML element?
- This topic has 8 replies, 1 voice, and was last updated 9 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
June 17, 2009 at 3:43 AM #22672
Hi Gurus [:)]
I’m quite new to BizTalk, trying to use it for two weeks now. Works quite well now, but ….
There are still a lot of questions unanswered. So here is one of them …
I’m generating a XML File which contais one record with protocol informations about the received file (count of records, sum of prices, …). It would be nice, if its possible to put the whole received XML-File into one element of this protocol XML file.
Is there an easy way to to this (without writing an external function) ?
-
June 17, 2009 at 4:07 AM #22674
sry, forgot to register.
so I’m the poster
-
June 17, 2009 at 4:26 AM #22675
Do you wish to put the original Xml message into the element as a string or as an Xml element?
If the former you can do this in an orchestration:XmlDocVariable = InputMessage;
OutputMessage.FileDataDistinguishedField = XmlDocVariable.OuterXml;If the latter then you can use a map.
-
June 17, 2009 at 4:44 AM #22677
I want to put the whole received XML Dokument (processed from a pipeline, as it is a flatfile before) into the protocol XML document.
Here is the schema of the XML protocol file:
<xs:element name=”Record“><xs:element name=”source“ type=”xs:string“ /><xs:element name=”record_count“ type=”xs:int“ /><xs:element name=”status“ type=”xs:string“ /><xs:element name=”Summe“ type=”xs:decimal“ /><xs:element name=”datetime“ type=”xs:string“ /><xs:element name=”Text“ type=”xs:string“ /><xs:element name=”content“ type=”xs:string“ /></xs:sequence></xs:complexType></xs:element>I I would like to put the received XML-File into the element “content”, if possible. Maybe it would be even better to put in the received flatfile there, but I can’t find a way to grap this information after using the pipeline for disassembly.-
June 17, 2009 at 6:44 AM #22678
Yes you can!
Encode the XML you wish to put in a field as let’s say Base64String. This is in a case you don’t need to see received XML visually, or for another reasons.
Or save it as CDATA[…] – look for the solution in internet.
-
June 18, 2009 at 5:42 AM #22682
Thx for this hint. It was part of the solution, but it seems there is another problem.
Here is what I produced:
<?xml version=”1.0″ encoding=”utf-8″?>
<ns0:Daten xmlns:ns0=”http://IMS_FlatFileHandler.SOB_Protokoll“>
<Record>
<source>Ennshafen Rechnungseingang</source>
<record_count>33</record_count>
<status>abgeschlossen</status>
<Summe>6579</Summe>
<datetime>2009-06-17T15:15:21</datetime>
<Text><![CDATA[<ns0:IMS_Invoice xmlns:ns0=”http://IMS_Schemas.PxB_RG_Standard” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”><position><ims_customer_no>123456</ims_customer_no><invoice_no>13210</invoice_no><invoice_date>”28.02.2009″</invoice_date><information xsi:nil=”true”></information><count_pos>33</count_pos><pos_no>1</pos_no><text>”Hub”</text><price_per_unit xsi:nil=”true”></price_per_unit><amount>1</amount><value>25,5</value><ims_order_no
….some more lines….xsi:nil=”true”></information><count_pos>33</count_pos><pos_no>33</pos_no><text>”Hub”</text><price_per_unit xsi:nil=”true”></price_per_unit><amount>1</amount><value>25,5</value><ims_order_no xsi:nil=”true”></ims_order_no><informations><container_id>”EISU4601611″</container_id><container_length>”20″</container_length><inbound_date>”27.02.2009″</inbound_date><inbound_code>”W”</inbound_code><outbound_date>”02.03.2009″</outbound_date><outbound_code>”L”</outbound_code><text>Turn-In: “202479” / Turn-Out: “” / Tage: 4</text></informations></position></ns0:IMS_Invoice>]]></Text>
<content>
</content>
</Record>
</ns0:Daten>I can produce this manually, but in the BizTalk Applikation it produces an error like “Value in field <Text> illegal”. (I use the german version, so sry about this lausy translation.
As I’m no XML-Guru [;)], I can’t find my fault. Maybe you can see the problem.
Thx in advance
-
June 19, 2009 at 12:26 AM #22687
After some investigations I found out, that it seems, there is a size limit for the content of CDATA. Is there a way to extend the max. lenght of the CDATA content? Or is this a restriction of BizTalk?
-
June 22, 2009 at 4:04 AM #22702
Hi again,
Don’t seems that there’s restriction for CDATA size. Message size? Not sure but sounds like possebility. Try insert as CDATA smaller messages, and then you will see on what size you get your exception.
-
June 23, 2009 at 1:58 AM #22710
already tried this.
Looks like the error occurs somwhere between 200 and 100 bytes.
-
-
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.