Hi,
I want to fetch the propertyDefinitions of a thingTemplate. I am calling GetMetadata service on the template -
client.invokeService(RelationshipTypes.ThingworxEntityTypes.ThingTemplates, "MyTemplateName", "GetMetadata", new ValueCollection(), DEFAULT_TIMEOUT);
This returns an empty propertyDefinitions infotable. The call works fine for entityType Things.
The rest call - GET <server>/Thingworx/ThingTemplates/MyTemplateName returns all the properties under path "effectiveShape/propertyDefinitions" in the response json.
How can I get the same using java sdk?
Regards,
Vaishnavee
Solved! Go to Solution.
I used an alternative api - 'GetInstanstanceMetadataAsJson' on ThingTemplate to get the metadata as a JSONObject. This object is similar to the output of rest call GET <server>/Thingworx/ThingTemplates/MyTemplateName.
I used an alternative api - 'GetInstanstanceMetadataAsJson' on ThingTemplate to get the metadata as a JSONObject. This object is similar to the output of rest call GET <server>/Thingworx/ThingTemplates/MyTemplateName.
Hi @slangley , Yes I tried that, returns _rows valueCollection of size zero. I dont know why it would do that. But only GetInstanceMetadataAsJSON worked for me.