<?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: Respond with JSON without using an InfoTable Template in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529933#M23301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I just saw this reply somehow. The workaround is to use PostText and passing the stringified JSON array as the content parameter, but this causes a null pointer exception that has to be caught in a try/catch block and makes the response unreadable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2017 01:34:28 GMT</pubDate>
    <dc:creator>jamesm1</dc:creator>
    <dc:date>2017-12-06T01:34:28Z</dc:date>
    <item>
      <title>Respond with JSON without using an InfoTable Template</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529925#M23293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a number of services in my solution that are invoked via RESTful POST requests from an external application.&amp;nbsp; The services must respond with a set of values.&amp;nbsp; Each service responds with a different set of values (and as the solution matures over time, these responses could become more diverse and more numerous).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The response from the services must be in a JSON format.&amp;nbsp; I've set up the services to have the result type = JSON, but everything I try generates an error with the service.&amp;nbsp; Here is a simplified example of what may be included in the response:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "siteId": &amp;lt;string&amp;gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // calculated by the service&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "areaName": &amp;lt;string&amp;gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // pulled from a different Thing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "percentFailed": &amp;lt;number&amp;gt;&amp;nbsp; // calculated by the service&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I create this structure as a JavaScript object, I was expecting to use &lt;SPAN style="font-family: 'courier new', courier;"&gt;result = JSON.stringify(responseObj)&lt;/SPAN&gt; to create a JSON object that could be used for the response.&amp;nbsp; The service crashes when converting the object to JSON just prior to finishing (i.e. the ThingWorx behind-the-scenes code can't convert it to a JSON response type).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the same as above, but set the result type to STRING in the service composer window, it doesn't crash, but the response contains lots of extraneous information.&amp;nbsp; For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: 'courier new', courier;"&gt;{\"dataShape\":&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt; color: #000000;"&gt;&amp;nbsp; \"fieldDefinitions\":&lt;SPAN style="line-height: 1.5em;"&gt;{&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #000000; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; \"result\":{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #000000; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \"name\":\"result\",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #000000; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \"description\":\"\",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #000000; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \"baseType\":\"STRING\",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #000000; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \"ordinal\":0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #000000; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \"aspects\":{}}}},&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #000000; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \"rows\":[{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \"result\":\"{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\\"siteId\\\":\\\"Site-47\\\",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\\"areaName\\\":\\\"Area 51\\\",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\\"percentFailed\\\":\\\"23.75\\\"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }\"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #000000;"&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-size: 11.0pt; font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is generating additional unnecessary parsing in the requesting application.&amp;nbsp; I would prefer to only have the &lt;SPAN style="font-family: 'courier new', courier;"&gt;result&lt;/SPAN&gt; object returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm of the understanding that I can create an InfoTable Template for the response, temporarily instantiate a table, populate it, and the return the table.&amp;nbsp; This will generate a JSON response.&amp;nbsp; However, I'd like to avoid this approach if possible because now I'm defining the response in two places (the template and the JavaScript).&amp;nbsp; Every time a developer needs to change the response, both places need to be updated.&amp;nbsp; Additionally, the solution would end up with numerous InfoTable Templates (one per service) that will need to be maintained.&amp;nbsp; This feels like a poor design choice to me and will increase future development unnecessarily.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'd like is to find a solution that doesn't require an InfoTable (uses only JavaScript objects) and returns a JSON object that only contains the response values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas are greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 18:36:44 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529925#M23293</guid>
      <dc:creator>deanm</dc:creator>
      <dc:date>2016-02-25T18:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Respond with JSON without using an InfoTable Template</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529926#M23294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dean,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use inbuilt function ToJSON&amp;nbsp; which is provided under snippets&amp;nbsp; to convert output of service into JSON objetct/format.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://www.ptcusercommunity.com/legacyfs/online/thingworx/2443_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 13:58:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529926#M23294</guid>
      <dc:creator>maneeshr</dc:creator>
      <dc:date>2016-02-26T13:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Respond with JSON without using an InfoTable Template</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529927#M23295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maneesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response, but that method is on ThingWorx objects, such as InfoTables, but is not standard JavaScript methods, so it will only work with objects that I've also defined in ThingWorx as a Template or DataShape and then instantiated within the service code.&amp;nbsp; I don't want to have to do that dual maintenance of objects (both as a ThingWorx object and as a JavaScript data structure) because that quickly becomes a support nightmare when the customer asks for changes to a response and those changes need to be implemented in multiple places.&amp;nbsp; (Note that I am dealing with responses from a third party customer's software, as opposed to my own company's software, so I have less control over what may be needed/desired on the responses in the future.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would prefer to only have to define the structure once in the JavaScript service and then return that structure as a JSON object without a bunch of extraneous ThingWorx wrappers on the JSON.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 15:03:50 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529927#M23295</guid>
      <dc:creator>deanm</dc:creator>
      <dc:date>2016-02-26T15:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Respond with JSON without using an InfoTable Template</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529928#M23296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dean,&lt;/P&gt;&lt;P&gt;What i understand is that you want to use standard JavaScript function to convert the output of Thingworx services which may be Infotable/String/Number into&amp;nbsp; JSON object.&lt;/P&gt;&lt;P&gt;what you can do is , add the result of service into an array and then convert that array into JSON object using standard function JSON.stringify(array).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 19:03:02 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529928#M23296</guid>
      <dc:creator>maneeshr</dc:creator>
      <dc:date>2016-02-26T19:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Respond with JSON without using an InfoTable Template</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529929#M23297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maneesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is exactly what I did.&amp;nbsp; The resulting response is the nested structure I shared in the original post.&amp;nbsp; There is a lot of extraneous ThingWorx information in the structure that the requesting application then needs to traverse to get to the actual response.&amp;nbsp; We are trying to avoid that additional traversing logic by only receiving the pertinent structure in the response.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 20:17:00 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529929#M23297</guid>
      <dc:creator>deanm</dc:creator>
      <dc:date>2016-02-26T20:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Respond with JSON without using an InfoTable Template</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529930#M23298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Result&amp;nbsp; type JSON is the one you want. I created a simple service to test this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "siteId": "hello",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "areaName": "test",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "percentFailed": "hi"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with output type JSON, and I tested in postman to get the expected result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="b" style="font-weight: bold; color: #444444; font-family: monospace; font-size: 13px;"&gt;{&lt;/SPAN&gt;&lt;SPAN class="ell" style="color: #444444; font-family: monospace; font-size: 13px;"&gt;&lt;/SPAN&gt;&lt;SPAN class="blockInner" style="padding-left: 24px; border-left: 1px dotted #bbbbbb; margin-left: 2px; color: #444444; font-family: monospace; font-size: 13px;"&gt;&lt;SPAN class="kvov objProp" style="padding-left: 20px; margin-left: -20px;"&gt;"&lt;SPAN class="k" style="color: #000000;"&gt;percentFailed&lt;/SPAN&gt;": &lt;SPAN class="s" style="color: #0b7500;"&gt;"hi"&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class="kvov objProp" style="padding-left: 20px; margin-left: -20px;"&gt;"&lt;SPAN class="k" style="color: #000000;"&gt;areaName&lt;/SPAN&gt;": &lt;SPAN class="s" style="color: #0b7500;"&gt;"test"&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class="kvov objProp" style="padding-left: 20px; margin-left: -20px;"&gt;"&lt;SPAN class="k" style="color: #000000;"&gt;siteId&lt;/SPAN&gt;": &lt;SPAN class="s" style="color: #0b7500;"&gt;"hello"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="b" style="font-weight: bold; color: #444444; font-family: monospace; font-size: 13px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="b" style="font-weight: bold; color: #444444; font-family: monospace; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="b" style="font-weight: bold; color: #444444; font-family: monospace; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="b" style="font-weight: bold; color: #444444; font-family: monospace; font-size: 13px;"&gt;Note: *THIS WILL NOT SHOW UP FROM WITHIN THE COMPOSER IF YOU TEST THE SCRIRPT. THE TEST SCRIPT WINDOW IN COMPOSER WILL NOT&amp;nbsp; DISPLAY JSON OR XML BASE TYPES. YOU NEED TO TEST THIS IN POSTMAN OR SOME&amp;nbsp; OTHER TOOL*&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One note: If you are&amp;nbsp; returning a JSON array, it will be wrapped in an object of the following structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result = [1,2,3]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will return&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "array": [1,2,3]&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a workaround for this, but it's a bit messy and depends what you are trying to do. I have a bug report open on this on Jira -- PSPT-2985.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2016 16:53:46 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529930#M23298</guid>
      <dc:creator>jamesm1</dc:creator>
      <dc:date>2016-12-02T16:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Respond with JSON without using an InfoTable Template</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529931#M23299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there any updates on this extra "array" addition bug? I just experienced the same issue? I'm trying to output a "pure" JSON array without any extra stuff around it and this messes up my plans.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you tell me anything more about the workaround? I'm creating my array manually with "var jsonObject = [];" and adding stuff there using push(). I tested the infotable.ToJSON but that created too much extra stuff for my taste.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My TW version: 7.2.5-b56&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Risto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 13:24:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529931#M23299</guid>
      <dc:creator>rvaaraniemi</dc:creator>
      <dc:date>2017-03-20T13:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Respond with JSON without using an InfoTable Template</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529932#M23300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dean,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you get the solution to your problem ??&lt;/P&gt;&lt;P&gt;OR any work around !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 20:20:44 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529932#M23300</guid>
      <dc:creator>ddas-2</dc:creator>
      <dc:date>2017-12-05T20:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Respond with JSON without using an InfoTable Template</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529933#M23301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I just saw this reply somehow. The workaround is to use PostText and passing the stringified JSON array as the content parameter, but this causes a null pointer exception that has to be caught in a try/catch block and makes the response unreadable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 01:34:28 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529933#M23301</guid>
      <dc:creator>jamesm1</dc:creator>
      <dc:date>2017-12-06T01:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Respond with JSON without using an InfoTable Template</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529934#M23302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe what happens with the array: [] response is that Thingworx uses JSONObject as the JSON basetype. When you return only an array, it uses the JSONArray class The two are not compatible classes, so Thingworx converts the array into an object using the name 'array' before returning the JSON. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my experience, if you return the JSON as a string from the service, you can get [{},{},...] to return from your service. You will have to then run var xxx=JSON.parse(thestring) to use it directly in the javascript.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 13:08:49 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Respond-with-JSON-without-using-an-InfoTable-Template/m-p/529934#M23302</guid>
      <dc:creator>BruceHulse</dc:creator>
      <dc:date>2017-12-08T13:08:49Z</dc:date>
    </item>
  </channel>
</rss>

