I was working on a cache system for Thingworx, done directly from the java SDK. The matter is that no Thingworx class is Serializable !
Not all classes should be, of course, but all the "result" classes as Infotable (and all needed subclasses) should be.
The other problem is that these classes or the classes they use are often final.
This means that if you want to serialize an Infotable, you have to create an entire set of objects that would be the serializable counterparts of the non serializable Thingworx objects. And that represents a lot of classes !
My question is : Will you make these classes serializable so that we can do stuffs like a cache system without re-coding the entire Thingworx API ??
Thanks a lot !
Just another note to this : The toJSON() and fromJSON functions are not working and we cannot even use them for an infotable...
Are you trying to use the Java SDK or create a Java Extension? What version of either of these are you using?
To be sure to talk about the same thing as you :
I was not doing this with the Thingworx java sdk comming from the market.
I was attempting to do it with a Thingworx java extension using the thingorx java api (downloadable from the support) and an external caching library.
When you look at the api, none of the objects are serializable.
And when you try to use the JSON methods that could have been used, these classes return null...
Even if this doesn't answer your question, I tried using Infotable.ToJSON(); in 6.6.2 and it works OK, returning a nice JSON.
Beware that there are 2 snippets: One is a resource (didn't use it) and one is an Infotable method (this is the one I used.)