Windchill API: Get ApplicationData object from ID?
We have a small Windchill customization created by a PTC consultant several years ago. This customization is called from ThingWorx with a wtpart ID. The customization collects representations of the wtpart and copies the content (typically PDF files) to a folder on the Windchill server to make it available to ThingWorx. The customization does a few things to get ApplicationData objects from the wtpart, then uses the ApplicationData object in a call to ContentServerHelper.service.writeContentStream() to download the file(s).
I'm using an OData endpoint in ThingWorx to get all the information I need about the representations, so I want to modify the Windchill customization to simply (hopefully) obtain a file given an ID like OR:wt.content.ApplicationData:12125968441. I'm assuming there is a way I can get the ApplicationData object from the ID string, then use the existing code to obtain the file.
My question is: In the Windchill API, how can I get the ApplicationData object from an ID string like "OR:wt.content.ApplicationData:12125968441"?
Here's what I've tried, and it's throwing an exception because I can't cast ApplicationData to ContentHolder. I really don't know what I'm doing here, just taking a stab at it.
ReferenceFactory rf = new ReferenceFactory();
WTReference reference = (WTReference) rf.getReference(objRef); // objRef is like "OR:wt.content.ApplicationData:12125968441"
ContentHolder holder = ContentHelper.service.getContents((ContentHolder) reference.getObject());
ApplicationData appData = ApplicationData.newApplicationData(holder);
Thanks for any advice.

