<?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>topic Re: How to parse simple XML-response from PostXML/PostText in ThingWorx Developers</title>
    <link>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526008#M20180</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mean in the tomcat/catalina startup?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Sep 2017 09:34:34 GMT</pubDate>
    <dc:creator>Pasi_Ojala</dc:creator>
    <dc:date>2017-09-15T09:34:34Z</dc:date>
    <item>
      <title>How to parse simple XML-response from PostXML/PostText</title>
      <link>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526004#M20176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I'm trying to post a device serialnumber to remote URL (not Thingworx) with PostXML-function and get a response with some device details (see below).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By using var xmlDocument = Resources["ContentLoaderFunctions"].PostText(params) I get the following response nicely as string:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Devices&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Total&amp;gt;0&amp;lt;/Total&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;Device&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DeviceData&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SerialNumber&amp;gt;A66M38&amp;lt;/SerialNumber&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DeviceType&amp;gt;10&amp;lt;/DeviceType&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DeviceData&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ItemData Quantity="1" Version=""&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Description1 Lang="EN"&amp;gt;Development engine&amp;lt;/Description1&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ItemData&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;/Device&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/Devices&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I try to do anything with PostXML (e.g. xmlDocument to Infotable) it seems that I do not get any XML data to Thingworx. I wonder, whether PostXML can be used in a case like this to get result as XML object? Am I missing something in PostXML usage?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quite a simple result so I could even use some sort of light-weight parser inside service? Any hints?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Pasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 08:30:04 GMT</pubDate>
      <guid>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526004#M20176</guid>
      <dc:creator>Pasi_Ojala</dc:creator>
      <dc:date>2017-09-13T08:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse simple XML-response from PostXML/PostText</title>
      <link>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526005#M20177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should work, if this is what you get back when you do PostText, then your PostXML should be able to get this back as an XML object.&lt;/P&gt;&lt;P&gt;So if you had var myXML = Resources.["ContentLoaderFunctions"].PostXML&lt;/P&gt;&lt;P&gt;Then you should be able to get information from myXML.Devices.Total&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 12:49:00 GMT</pubDate>
      <guid>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526005#M20177</guid>
      <dc:creator>PaiChung</dc:creator>
      <dc:date>2017-09-13T12:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse simple XML-response from PostXML/PostText</title>
      <link>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526006#M20178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PostText delivers the content nicely. PostXML just like you said, but myXML.Devices.Total is empty. Any idea where to start hunting the reason for this behavior? Could it be that content-type is a problem for Thingworx? Using Postman I see that the content-type for response is &lt;SPAN style="color: #808080; text-transform: none; text-indent: 0px; letter-spacing: normal; font-family: 'Segoe UI', Tahoma, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; orphans: 2; widows: 2; background-color: #ffffff; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;text/xml; charset=utf-8. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 07:55:52 GMT</pubDate>
      <guid>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526006#M20178</guid>
      <dc:creator>Pasi_Ojala</dc:creator>
      <dc:date>2017-09-14T07:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse simple XML-response from PostXML/PostText</title>
      <link>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526007#M20179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have the UTF-8 option configured in the Java opts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 13:00:39 GMT</pubDate>
      <guid>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526007#M20179</guid>
      <dc:creator>PaiChung</dc:creator>
      <dc:date>2017-09-14T13:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse simple XML-response from PostXML/PostText</title>
      <link>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526008#M20180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mean in the tomcat/catalina startup?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2017 09:34:34 GMT</pubDate>
      <guid>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526008#M20180</guid>
      <dc:creator>Pasi_Ojala</dc:creator>
      <dc:date>2017-09-15T09:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse simple XML-response from PostXML/PostText</title>
      <link>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526009#M20181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pasi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't lose time with PostXML, use PostText and then if you want you can try to parse to XML the content you receive with new XML(postTextResult); or alike.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just my recommendation,&lt;/P&gt;&lt;P&gt;Carles.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2017 10:14:55 GMT</pubDate>
      <guid>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526009#M20181</guid>
      <dc:creator>CarlesColl</dc:creator>
      <dc:date>2017-09-15T10:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse simple XML-response from PostXML/PostText</title>
      <link>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526010#M20182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. I will check the encoding issue first and if it does not help, continue with building the case with posttext.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2017 17:30:38 GMT</pubDate>
      <guid>https://community.ptc.com/t5/ThingWorx-Developers/How-to-parse-simple-XML-response-from-PostXML-PostText/m-p/526010#M20182</guid>
      <dc:creator>Pasi_Ojala</dc:creator>
      <dc:date>2017-09-15T17:30:38Z</dc:date>
    </item>
  </channel>
</rss>

