saving complete XML in XML element?

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › saving complete XML in XML element?

Viewing 1 reply thread
  • Author
    Posts
    • #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) ?

       

    • #22674

      sry, forgot to register.

      so I’m the poster

      • #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.

        • #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:complexType>
          – <xs:sequence>
            <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.
          • #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.

            • #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>&lt;![CDATA[&lt;ns0:IMS_Invoice xmlns:ns0=”http://IMS_Schemas.PxB_RG_Standard” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”&gt;&lt;position&gt;&lt;ims_customer_no&gt;123456&lt;/ims_customer_no&gt;&lt;invoice_no&gt;13210&lt;/invoice_no&gt;&lt;invoice_date&gt;”28.02.2009″&lt;/invoice_date&gt;&lt;information xsi:nil=”true”&gt;&lt;/information&gt;&lt;count_pos&gt;33&lt;/count_pos&gt;&lt;pos_no&gt;1&lt;/pos_no&gt;&lt;text&gt;”Hub”&lt;/text&gt;&lt;price_per_unit xsi:nil=”true”&gt;&lt;/price_per_unit&gt;&lt;amount&gt;1&lt;/amount&gt;&lt;value&gt;25,5&lt;/value&gt;&lt;ims_order_no
              ….some more lines….

              xsi:nil=”true”&gt;&lt;/information&gt;&lt;count_pos&gt;33&lt;/count_pos&gt;&lt;pos_no&gt;33&lt;/pos_no&gt;&lt;text&gt;”Hub”&lt;/text&gt;&lt;price_per_unit xsi:nil=”true”&gt;&lt;/price_per_unit&gt;&lt;amount&gt;1&lt;/amount&gt;&lt;value&gt;25,5&lt;/value&gt;&lt;ims_order_no xsi:nil=”true”&gt;&lt;/ims_order_no&gt;&lt;informations&gt;&lt;container_id&gt;”EISU4601611″&lt;/container_id&gt;&lt;container_length&gt;”20″&lt;/container_length&gt;&lt;inbound_date&gt;”27.02.2009″&lt;/inbound_date&gt;&lt;inbound_code&gt;”W”&lt;/inbound_code&gt;&lt;outbound_date&gt;”02.03.2009″&lt;/outbound_date&gt;&lt;outbound_code&gt;”L”&lt;/outbound_code&gt;&lt;text&gt;Turn-In: “202479” / Turn-Out: “” / Tage: 4&lt;/text&gt;&lt;/informations&gt;&lt;/position&gt;&lt;/ns0:IMS_Invoice&gt;]]&gt;</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

              • #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?

                • #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.

                   

                  • #22710

                    already tried this.

                    Looks like the error occurs somwhere between 200 and 100 bytes.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.