Uniface on GitHub
Fixes and Updates
Author: firstname.lastname@example.org (danieto)
Does Uniface 9.4 Supports JSON?
For example, creating a Uniface Web Service that will receive data in a JSON format instead of XML.
what exactly do you need? I got a tiny code that turns a Uniface List into JSON! This will be part of my next "Uniface Frontend Templating" series (Part 4).
In case of beeing impatient, the code is not that sophisticated. JSON is a pretty clean form for structured data.
"Uniface uses the JSON format for updating dynamic server pages using websave and webload"
I would assume U9.4 NOT to deliver JSON directy for other purposes than websave and webload! If you want to digg deeper into this, then let me know :)
I've got some very hacky and quite complex code for turning lists into JSON and vis versa - I had to remove UTF8 at the same time.
I'd be too embarrased to share it though.
I'd like to see more direct support and a more elegant solution
Just because I'm that curios ... @ AyeJay
Doing so makes it easier to handle it :)
My code looks like : http://www.udev.info/uniface/uniface-web-tools-ulist2json/
/EDIT: getting old, I guess. I already did that contribution with complete examples on 2010-07-23! ... *doh*
Interesting question - one I never really asked myself.
Because I was accessing someone else's web service and I was told I was going to get JSON as a response and picking the data out of JSON in a sort of ad-hoc way is the idiom in the application in question.
I was doing this in the context of a uniface service rather than web page.
I'd like to find a better way - Always willing to share my mistakes (within the bounds of commercial confidentiallity) and hopefully learn from them
Thanks for the lists 2 JSON code
... you're welcome :)
Unfortunately the webload/websave commands do not have the same level of component structure mapping support that are available for xmlload/xmlsave. They just dump out the entire structure and currently only seem meant to support Dynamic Server Pages. We use an XSLT transformation to generate JSON from an XML document.
© 2021 Uniface Privacy & Cookies | Privacy Statement | Legal