JSON wrapping query and invocation from EDMS
To correctly process JSON input and output for arbitrary queries, all invocations should be done through the special 'wrapper' ExpressX Query Function (this function is automatically
published/generated by the SSP Framework on starting the EDM Application Server). This 'wrapper' query function decodes JSON into 'native' EDM parameter types, invokes the target Query Function and then encodes 'native' EDM return types to JSON format. A special option allows to skip encoding retuned value – suitable for situations when results are already encoded or it is expensive to encode them (in this case the query return type should be simply STRING).
Below is an example of invoking an arbitrary query with JSON input/output data, using EDMS:
Execute Remote Query dialog:
Remote repository: DataRepository
Remote model: PLUGINQUERYSCHEMA_DUMMYMODEL
Remote Query schema: PLUGINQUERYSCHEMA Remote query: EARLYBINDINGJSON
Execute Remote Query Parameters dialog (\STRING\ below is the explicit type specialization for parameters that are actually declared as GENERIC):
1:\STRING\jsonstring
2: \STRING\RepositoryName.ModelName 3:ExpressSchemaName.QuerySchemaName.FunctionName 4:options
'Jsonstring' is a JSON object containing named parameters for target query functions – names are case sensitive and should be in the same order as in the query function, types of parameters shall match. All parameters shall be present. JSON null is treated and can be used to represent the EXPRESS '?' value.
'Options' default value is 0. Set it to 1 to skip JSON conversion of returned values (works only for Queries that return simple STRING).
The second parameter can be replaced by \INTEGER\EDMModelInstanceID.
NOTE: As the SSP Framework is only present in the EDM Application server, all functionality works only for 'execute remote query'.
NOTE (for SSP only): There are SSPs that do not have a target model (they always use 'PLUGINQUERYSCHEMA_DUMMYMODEL') – to invoke such Queries, leave the second parameter unset and for the third parameter use simply 'QuerySchemaName.FunctionName'.