Take a look at the ThingShapeUtilities class in the SDK. There are a couple implementations of getImplementingThings() that take a ThingShape or EntityReference as an argument and will return an EntityReferenceCollection which you can call toInfoTable() if you need it in that form. It doesn't take advantage of the query logic, but can get you a list of Things that implement that ThingShape.
I was able to get the SetThingsByShape() call to work in Java but the query parameter is not being applied. I have tried a number of ways of constructing the JSONObject query parameter. Here is an example of the Java code ...
JSONObject filter = new JSONObject();
JSONObject query = new JSONObject();
Searcher searcher = new Searcher();
InfoTable things = searcher.SearchThingsByShape("CP_ThingShape", (double)100, null, null, query);
In this application there will always be exactly one Thing that is derived from CP_ThingShape that has the specified DeviceId.
So the InfoTable should always have exactly one row, but instead I get as many rows as there are Things derived from CP_ThingShape.
Is the query parameter not formed correctly?
An alternate method was found by Joe Daniel that works as expected.
[Note that CP_ThingTemplate includes CP_ThingShape].
ThingTemplate template = (ThingTemplate)EntityUtilities.findEntity("CP_ThingTemplate", ThingworxRelationshipTypes.ThingTemplate);
InfoTable newThings = template.QueryImplementingThingsWithData(null, null, null, query);
In our application, the InfoTable newThings always has 1 entry, which is the thing that has the matching DeviceId.
Note that the query parameter used here is the same JSONObject that was used with the SearchThingsByShape.
Case 12996594 asserts that the SearchThingsByShape library call does not handle the query parameter correctly.