I need to write some DataSnap “middleware” between Google Glass and a SwissLog ERP system, and I am trying to figure out if there are significant differences between running the DataSnap as a standalone service (or app, for debugging) – and running as a CGI ISAPI plugin for IIS on a standard Windows Server.
Will the CGI be invoked per http session – or will there be a shared session running continously? I’ve never worked with CGI ISAPI before, so this is definitively a learning “opportunity”.
Pointers to relevant documentation would be appreciated.
Wandering about for the first time in the Json classed of Berlin, I have a few questions from a noob perspective, which I hope someone with experience can enlighten me on.
I am implementing the JsonRPC protocol, where a request basically looks like this:
I.e. The method name may vary, and with it the “params” – or implicitly, the type of the JSon object that recides in “params”. The challenge here is that I don’t know the type, until I have identified the content of “method”.
Using TJSon, it is trivial to get the value – but relatively costly, since it will also parse “params” – which can be large and complex.
// property fields omitted for brevity
class TJSonRPC = class
property jsonrpc: String;
property method: String;
property params: String;
property id: String;
And if I parse
rpc := TJSon.JsonToObject(ReceivedJsonString);
“rpc” will contain the correct string values in the “jsonrpc”, “method” and “id” fields – while “params” will be an empty string, since it was an unknown object type.
I use “method” to look up the associated “params” type, as well as the handler methods. Now I have to reparse the whole thing again – instead of avoiding the first parsing of params, and then only parsing params with the right type later.
So, after this long intro – my question is: Can I persuade TJSon to treat “params” as it was a string and not an object for the TJsonRPC class?