Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hello,
I'd really like to find out if Kepware can receive JSON data resulting from a JSON post.
Thank you
Solved! Go to Solution.
Hi SB,
Thanks for writing in. I believe you wish to ingest a custom JSON structure from another system, and that we should act as an HTTP server in order to receive a POST command that will share this custom structure. Can you also help me understand where you want the data to go once Kepware has recived this JSON structure? In other words, over what server interface will Kepware send the parsed data? OPC DA? OPC UA? MQTT? SQL? Etc.
Regardless of the data output, the tool that Kepware offers for ingestion/receipt and parsing of custom JSON structures over HTTP is our Universal Device Driver. This is user-customizable driver with a Javascript-based API. Here is the Kepware product page for this tool and below that I've linked sample code. FYI that the closest sample code to your requirement is likely the "CSV file import" sample code; I built a server-side UDD profile to consume JSON-type structures pushed from the related Python script. You can ignore the Python script and just look at the UDD portion to see how the profile is configured for "server" mode and payload parsing:
UDD: Universal Device Driver (UDD) | OPC Server | Kepware
PTC Github for UDD Example Code: Universal-Device-Driver-Examples/Generic Use Cases/CSV Data Import at main · PTCInc/Universal-Device-Driver-Examples · GitHub
If you need any further help please send an email to my Kepware Solutions Consulting team: presales.support@kepware.com.
Thanks,
Sam
Hi SB,
Thanks for writing in. I believe you wish to ingest a custom JSON structure from another system, and that we should act as an HTTP server in order to receive a POST command that will share this custom structure. Can you also help me understand where you want the data to go once Kepware has recived this JSON structure? In other words, over what server interface will Kepware send the parsed data? OPC DA? OPC UA? MQTT? SQL? Etc.
Regardless of the data output, the tool that Kepware offers for ingestion/receipt and parsing of custom JSON structures over HTTP is our Universal Device Driver. This is user-customizable driver with a Javascript-based API. Here is the Kepware product page for this tool and below that I've linked sample code. FYI that the closest sample code to your requirement is likely the "CSV file import" sample code; I built a server-side UDD profile to consume JSON-type structures pushed from the related Python script. You can ignore the Python script and just look at the UDD portion to see how the profile is configured for "server" mode and payload parsing:
UDD: Universal Device Driver (UDD) | OPC Server | Kepware
PTC Github for UDD Example Code: Universal-Device-Driver-Examples/Generic Use Cases/CSV Data Import at main · PTCInc/Universal-Device-Driver-Examples · GitHub
If you need any further help please send an email to my Kepware Solutions Consulting team: presales.support@kepware.com.
Thanks,
Sam
Hi Sam,
Thanks for the reply! Our setup (as best as I can describe it) is that we are talking to a PLC to get some test results, then posting a JSON payload via REST client to a web server. We've tested this on KepServerEX 6 and it works (we're still in evaluation mode). Next what we need to be able to do is post a request to the same server (different url) using another JSON payload indicating the serial number of the part we just tested, receive a reply in the form of JSON data, then parse the associated values that we need from that reply. Does that sound doable? If so could we do it with just KEPServerEX 6 (plus any modules we would need to purchase)? FYI I'm replying before I dive into the links you posted - we had assumed that we were going to go ahead with the purchase of Kepware, and just wanted to sort out any specific licenses we might need to purchase, but we have to find out quickly if we can get data back or not.
Thanks,
Sean