<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Cannot transform JSON document to XML: JSON document does not start with '{'. in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654176#M4747290</link>
    <description>&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;I proved your solution but I recive another error:&lt;/P&gt;&lt;P&gt;com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 519 path $&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2023 16:00:01 GMT</pubDate>
    <dc:creator>former_member841349</dc:creator>
    <dc:date>2023-02-10T16:00:01Z</dc:date>
    <item>
      <title>Cannot transform JSON document to XML: JSON document does not start with '{'.</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaq-p/12654171</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;
  &lt;P&gt;I have an issue in CPI using the JSON to XML converter, I tried to use it and CPI response me the next message: com.sap.it.xmljson.JsonXmlException: Cannot transform JSON document to XML: JSON document does not start with '{'.&lt;/P&gt;
  &lt;P&gt;I have the following JSON body that I need to convert to XML&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2140510-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I know the problem is [ at the beginning of the body. My question is, how can I remove that symbol to be able to use the JSON to XML converter?&lt;/P&gt;
  &lt;P&gt;I appreciate your answers&lt;/P&gt;
  &lt;P&gt;greetings&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 21:59:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaq-p/12654171</guid>
      <dc:creator>former_member841349</dc:creator>
      <dc:date>2023-02-09T21:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot transform JSON document to XML: JSON document does not start with '{'.</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654172#M4747286</link>
      <description>&lt;P&gt;I'd say it makes more sense to look further upstream and understand why you have invalid JSON at that step.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 22:11:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654172#M4747286</guid>
      <dc:creator>Ryan-Crosby</dc:creator>
      <dc:date>2023-02-09T22:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot transform JSON document to XML: JSON document does not start with '{'.</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654173#M4747287</link>
      <description>&lt;P&gt;Hi Ryan, this is the beginning of the message, this is the json that the server responds. I want to know how I can delete that symbol&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 04:22:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654173#M4747287</guid>
      <dc:creator>former_member841349</dc:creator>
      <dc:date>2023-02-10T04:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot transform JSON document to XML: JSON document does not start with '{'.</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654174#M4747288</link>
      <description>&lt;P&gt;Hello Sara,&lt;/P&gt;&lt;P&gt;this is a limitation from the Json to XML Converter as stated in the &lt;A href="https://help.sap.com/docs/CLOUD_INTEGRATION/368c481cd6954bdfa5d0435479fd4eaf/3a02829ea84e4f7dac62bdd10d06b084.html"&gt;documentation&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;You can simply add a content modifier as described their and process the message.&lt;/P&gt;&lt;P&gt;Here an example with a simulation. I also had to add a second "root" element as their is alos a limitation that the root Object can only have one member. So I added a second root (the name can be adjusted in the Converter).&lt;/P&gt;&lt;P&gt;Content Modifier:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2138512-json1.png" /&gt;&lt;/P&gt;&lt;P&gt;JSON to XML Converter:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2138515-json11.png" /&gt;&lt;/P&gt;&lt;P&gt;Simulation Body input:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2138517-json2.png" /&gt;&lt;/P&gt;&lt;P&gt;Simulation Body Middle:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2138518-json21.png" /&gt;&lt;/P&gt;&lt;P&gt;Simulation Body End:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2138519-json3.png" /&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you with your issue.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 08:11:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654174#M4747288</guid>
      <dc:creator>RobertQ</dc:creator>
      <dc:date>2023-02-10T08:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot transform JSON document to XML: JSON document does not start with '{'.</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654175#M4747289</link>
      <description>&lt;P&gt;Hi Rian,&lt;/P&gt;&lt;P&gt;another simple solution without adding an additional root tag to the payload is to insert a script step which removes the first an the last String&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;def inputJson = message.getBody(String)
def outputJson = inputJson.substring(1, inputJson.length()-1)
message.setBody(outputJson)
return message&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Feb 2023 08:31:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654175#M4747289</guid>
      <dc:creator>chris_75</dc:creator>
      <dc:date>2023-02-10T08:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot transform JSON document to XML: JSON document does not start with '{'.</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654176#M4747290</link>
      <description>&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;I proved your solution but I recive another error:&lt;/P&gt;&lt;P&gt;com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 519 path $&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 16:00:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654176#M4747290</guid>
      <dc:creator>former_member841349</dc:creator>
      <dc:date>2023-02-10T16:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot transform JSON document to XML: JSON document does not start with '{'.</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654177#M4747291</link>
      <description>&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;Your solutions works,&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 18:47:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654177#M4747291</guid>
      <dc:creator>former_member841349</dc:creator>
      <dc:date>2023-02-10T18:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot transform JSON document to XML: JSON document does not start with '{'.</title>
      <link>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654178#M4747292</link>
      <description>&lt;P&gt;Hello &lt;SPAN class="mention-scrubbed"&gt;jaimestrada&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;if the solution works, please mark my answer as accepted, so other peaople can find this solution more easily.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 08:06:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cannot-transform-json-document-to-xml-json-document-does-not-start-with/qaa-p/12654178#M4747292</guid>
      <dc:creator>RobertQ</dc:creator>
      <dc:date>2023-02-13T08:06:06Z</dc:date>
    </item>
  </channel>
</rss>

