Json Custom Parsing Assist

Hi There,

I need some guidance as to whether the following is even possible. - We have a system where we get the following JSON message:
{
"type" : "DeviceCommand",
"sessionId" : "86a624c5-fa85-4e82-8c5b-0c09774139a3",
"controllerId" : "PLC_NAME",
"devices" : [ {
"moduleType" : "Custom",
"deviceId" : "g_ASOUTBOUNDPORT220READY",
"command" : ""
} ]
}

The INTENT of the message is to request the current value of "g_ASOUTBOUNDPORT220READY" from "PLC_NAME" (which can be any of a number of PLC's connected to Ignition)

The EXPECTED response message we need to generate SHOULD look like:
{
"type" : "DeviceStatus",
"sessionId" : "86a624c5-fa85-4e82-8c5b-0c09774139a3",
"controllerId" : "PLC_NAME",
"devices" : [ {
"moduleType" : "Custom",
"deviceId" : "g_ASOUTBOUNDPORT220READY",
"command" : "TRUE"
} ]
}

Thank You for any feedback

How is this message delivered? Are you using the WebDev module to handle an incoming API request? WebDev will handle json for you, converting to/from jython dictionaries and lists.

Hi Phil,

We were actually doing this using CirrusLink MQTT and connection to an AMQ (Apache) server that acts like the broker. So the "interfacing" was done via that. - THere was some scripting around "message received / populate response / send the response" items.

However we have since started looking at the WebDev module (still learning) and are busy exploring this. - We are at this moment still thinking to "subscribe" to the AMQ topics and process replies to the relevant "return topic".