0 Followers · 433 Posts

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.

Question Tamara Lebedeva · Aug 22, 2016

Hi, all. I have CSP application and it needs to get and process data from ajax request with json-content. JSON can be very big. In this case: TRY { Set RequestObj = ##class(%Object).$fromJSON(%request.Content.Read()) } CATCH(Exception) { Set Status=Exception.AsStatus() } I get just part of getting JSON and validate error in $fromJSON. If I try to read it all in cycle: TRY { While (%request.Content.AtEnd = 0) { Set Data=Data_%request.Content.Read()
} Set RequestObj = ##class(%Object).$fromJSON(Data) } CATCH(Exception) { Set Status=Exception.AsStatus() } I get <MAXSTRING> error. Increasing of MaxLocalLengt isn't solution. Is there some good way parse big JSON?

6
0 1651
Article Rob Tweed · Jun 22, 2016 14m read

In this article I'll describe how to set up web services and/or REST services using EWD 3.

Since EWD 3 is designed to be modular, you can construct the environment that exactly meets your needs, but for much of the time you'll probably find that the pre-built EWD 3 ewd-xpress super-module does most of what you need because it hooks together all the core EWD 3 and other building-blocks you'll need:

1
1 1439
Article Ward De Backer · Jun 23, 2016 5m read

As Rob explained in an earlier post, Caché's Node.js interface allows you to create Web Services and REST Services using the very modular EWD 3 framework.

These services by default return a JSON response with Content-Type: application/json and the response body contains the JSON you return using the finished() method, so:

finished({ test: 'test response' });

returns

{ "test": "test response" }

with a HTTP content-type of application/json

0
0 3285
Question Joseph Thottungal · Jun 16, 2016

Hi,

I am trying to use data transformation (DTL) to map a JSON to SDA. My elements in the source JSON is not one to one with SDA object. That means I have to add code to loop through these objects in order to complete the mapping. Can someone send me a sample that can look to create that? I am not very comfortable with scripting language used in Health Share. Appreciate your help.

Regards

Joseph

2
0 794
Article Stefan Wittmann · May 31, 2016 12m read

Introduction

The field test of Caché 2016.2 has been available for quite some time and I would like to focus on one of the substantial features that is new in this version: the document data model. This model is a natural addition to the multiple ways we support for handling data including Objects, Tables and Multidimensional arrays. It makes the platform more flexible and suitable for even more use cases.

12
0 2787
Question Kevin Furze · May 23, 2016

I am playing with json output from result sets

I've generated a dynamic resultset and now doing the json and I can get Array's with nested Objects but I'm trying to get to Objects nested with another object

mainObj = ##class(%Object).$new()
set array=[]
  While (result.Next()) {
     s object = ##class(%Object).$new()
     s object.id = result.Data("ID"
     s object.reg = result.Data("Registration")
     s object.snNum = result.Data("SatNavVehNumber")
     do array.$push(object)
     }
  w !!,array.$toJSON()

[{"id":"78","reg":"HIRE VEH","snNum":"234"},{"id":"86","reg":"HJ65 HJK","snNum":"567"}]
5
0 1109
Question Nicki Vallentgoed · Apr 19, 2016

MessagePack is a binary-based efficient object serialization library. It enables to exchange structured objects between many languages like JSON. But unlike JSON, it is very fast and small.

Any chance of adding support for MessagePack?

2
0 468
Question Chris Stewart · Mar 29, 2016

Hi

I have been experimenting with the creation of a set of REST services for an app.  The basic GET operation is set to create a %ZEN.proxyObject instance, and then set an instance of a Persistant class as a property, which gives me all of the values I want to return.  However, it also gives me some values that I don't want to return over REST (because they are both private, and large registered objects which will bog down performance)

How do I remove these values from the ZENproxyObject?  I can only see a full clear() in the documentation, but nothing which can remove individual elements

Thanks

3
0 550
Article Steve Glassman · Feb 19, 2016 1m read

I am pleased to announce the next 2016.2 field test kit, 2016.2.0.595.0.

It may look like a slow week, with less than fifty changes having been checked in, but this kit includes the following fixes to problems found by you, the ones running the kits in the field:

  • ALE2845, which fixes the cachejdbc.jar version
  • JN1637, which fixes an issue that blocked debugging Atelier when used in conjunction with Kerberos
  • DLP3508, which fixes a JSON issue with $compose()

The rest of the fixes have been spread among different areas of the product, chief among them DOCUMENT Data Model, SQL and Atelier.

0
0 335