Invoke Service which returns blob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Invoke Service which returns blob
i try to invoke service wich returns blob output with
Thing db = ThingUtilities.findThing("dbThing");
InfoTable result = db.processServiceRequest("customService", null);
but how to convert infotable to byte array?
best reggards
Solved! Go to Solution.
- Labels:
-
Extensions
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Ä°f anyone can't fgure out how to read data from service;
ValueCollection params = new ValueCollection();
params.put("path", new StringPrimitive(<calledServiceInputs>));
InfoTable table = file.processServiceRequest("LoadBinary", params);
ValueCollection value = table.getFirstRow();
byte[] content = (byte[]) value.getValue(<serviceReturnValueName(example:Result>));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
Article - "How to convert a ThingWorx Infotable to JSON": https://www.ptc.com/en/support/article/CS304859
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
thank you for repling. in Java there is json but i want to byte array. so toString and .toByte is my solution. I'm not checkin as solituon because i'm not sure is it working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Ä°f anyone can't fgure out how to read data from service;
ValueCollection params = new ValueCollection();
params.put("path", new StringPrimitive(<calledServiceInputs>));
InfoTable table = file.processServiceRequest("LoadBinary", params);
ValueCollection value = table.getFirstRow();
byte[] content = (byte[]) value.getValue(<serviceReturnValueName(example:Result>));