9 Followers · 445 Posts

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

Question Pavithra Rajamohan · Jun 29, 2020

Hello,

I would like some advice please. I am trying to send a Httpnetrequest in the form of a JSON message. To request for the web token I have created a method which has the relevant message body and its corresponding values and sent this to the Process. The Process has a method called Transform Message which takes the message and changes it to JSON format and passes it through to the Operation. The Operation currently has the basic HTTPNetrequest listing the relevant information for the website that we are trying to reach. The task has been created to try and invoke the service into action.

1
0 417
Question Michael Fimbres · Jun 18, 2020

Running Cache 2017.2.2.

I'm trying to make a REST API call in JSON format. When using the example in the class reference documentation the getJSON method in the %Net.Http class throws the error  <METHOD DOES NOT EXIST> on a %Clone() method in the %LIbrary.DynamicObject class. I even changed the parameter to a JSON string to no avail. The  code will then fail on the %Compose method (examples below). My workaround is to use the %Net.HttpRequest functionality. Is there another workaround to this?

Example As Is:

2
0 331
Announcement Rob Tweed · Jun 11, 2020

If you're interested in building a browser-based CRUD application for maintaining data on IRIS, check out the detailed, step-by-step tutorial at:

https://github.com/robtweed/qewd-microservices-examples/blob/master/WIN…

To get a preview of the application you'll build in the tutorial, along with background on its technology stack, watch this video:

https://www.youtube.com/watch?v=d-NICYqv_2s

In summary, the key features and technologies that you'll be using and building out in this tutorial include:

0
0 1281
Article Oleh Dontsov · Jun 4, 2020 1m read

Sometimes you need quickly and easily import data into IRIS. For this, an IRIS import manager has been developed.

This application allows you to import JSON data and also provides a really simple interface for transferring data from MongoDB collections to IRIS globals. It has never been so easy.

Let's look at examples.

Import JSON

Suppose we have data in JSON format and we want to import it into IRIS. To do this, you just need to specify the global name and insert the data. After import, you will see the imported data. If global exists data will be overwritten.

Import MongoDB collections

5
0 792
Question Warren Baldock · May 26, 2020

Hello All,

I am compiling a REST Operation to call our hospital Administration system, following tutorials around the REST API's etc. First time we have integrated like this so not much knowledge around our hospital - hoping someone on here can help.

I have been using the JSONStreamToObject Method which is working as i expected, apart from trying to get a specific item in the example JSON Response as follows:

{"test":"abc","name":[{"use":"usual","family":"Matest","given":["Mia"]}]}

2
0 658
Announcement Rob Tweed · May 15, 2020

I've created a new repository that I will use for providing examples of various scenarios and use cases for QEWD

https://github.com/robtweed/qewd-microservices-examples

Initially it contains a example of a scenario I'm often asked about: a set of REST APIs, with JWT support, implemented as a set of QEWD MicroServices, each of which uses Cache or IRIS running on a Windows system.

What I've provided is a detailed, step-by-step guide (with detailed explanations) of how to set up such a system.

The example shows a use case of REST APIs to:

- authenticate / login

0
1 502
Announcement Guillaume Rongier · May 5, 2020

objectscript-json-patch

An implementation of JSON-Patch in ObjectScript.

Why you should use JSON-Patch

JSON-Patch (RFC6902) is a standard format that allows you to update a JSON document by sending the changes rather than the whole document. JSON Patch plays well with the HTTP PATCH verb (method) and REST style programming.

Install

With zpm :

USER>zpm
zpm:USER>install objectscript-json-patch

How-To use it

Use it with this call :

Do ##class(Grongier.JSON.Utils).Patch(tDoc,tPatch)

Where :

  • tDoc is a %DynamicObject (JSON)
  • tPatch is a %DynamicArray of the patches (the JSON Patch).
2
1 487
Question Thembelani Mlalazi · Nov 14, 2017

I am using studio 2015 version which does not have dynamic objects and I need to read xml and convert that to a json I have managed to come close to json string but with little difficulties .I need to be able to identify the root element and specify where to put braces between objects  anyone  with any idea is welcome he is my code so far

12
0 1710
Article Lorenzo Scalese · Apr 27, 2020 1m read

Hi community,

This article to give a description of my small library JSON Filter.

Why JSON Filter?

Search, sort data are common operations.

But … How to do this with JSON data?

You can use a %DocDB, It’s a good way for storing JSON and index the main properties.

However, JSON document is very flexible. It isn’t always possible (and not recommended) to index each properties to process the wished queries. A manual processing on a data subset is may be required.

In my opinion, this is not a funny part of the job. It’s a repetitive code with many loops etc...

1
1 593
Article Oliver Wilms · Apr 24, 2020 2m read

I enjoy the challenge of being in a contest. Currently I participate in InterSystems IRIS with REST API Programming Contest. My idea for this contest was to create an app to help me keep track of tasks for my Status Reports. I started with the template provided by Evgeny Shvarov. I created a persistent class for Tasks and a REST Dispatch class. I defined my URL map and I even figured out how to test my REST app using Postman. I felt proud of myself for a little while. Then I noticed It seemed odd to type my tasks in JSON format in Postman and submit a POST request to get a new task into my

1
0 292
Question Florian Hansmann · Apr 16, 2020

Hey Community,

my Caché Version is 2013.1 and I can't update now.

I want to serialize a SQL Answer row into an Array filled with objects and then convert it to json.

Actually I use the following, which is very error prone when I have to do that often:

7
0 850
Question Rubens Silva · Apr 15, 2020

Hello,

Recently I have been required to work with a method called ExportToStream.

The situation asks me to export a UTF-8-encoded JSON as a XML to be imported on old releases. Here's how I attempted to fulfill this request:

do $System.OBJ.ExportToStream("path/to/my/json/file.json", .stream,,,"UTF8")

The file is indeed encoded as UTF-8 and although the XML header denotes that it has been exported as UTF8:

<?xml version="1.0" encoding="UTF8"?>

The body content seems to differ:

"text": "Condição de pagamento sujeito a análise de crédito: "
10
0 1165
Article Evgeny Shvarov · Nov 3, 2017 3m read

There are several options how to deliver user interface(UI) for DeepSee BI solutions. The most common approaches are:

  • use native DeepSee Dashboards, get web UI in Zen and deliver it in your web apps.
  • use DeepSee REST API, get and build your own UI widgets and dashboards.

The 1st approach is good because of the possibility to build BI dashboards without coding relatively fast, but you are limited with preset widgets library which is expandable but with a lot of development efforts.

The 2nd provides you the way to use any comprehensive js framework (D3, Highcharts, etc) to visualize your DeepSee data, but you need to code widgets and dashboards on your own.

Today I want to tell you about yet another approach which combines both listed above and provides Angular based web UI for DeepSee Dashboards -  DeepSee Web library.

16
5 2649
Question Mario Sanchez Macias · Mar 17, 2020
 

Hi, 

I know there are several alternatives, but I would like to find the easiest & simpler ones to store data coming in Json format from post requests and also allowing me to do SQL queries. 

I want to have a property called favouriteColors. I want to store a few colors, and I want to be able to do queries to get top favorite colors, etc... so not handling the list of colors as just a fixed string or fixed object. 

4
0 635
Article Jose-Tomas Salvador · Apr 25, 2018 2m read

What if you could serialize/deserialize objects in whatever format: JSON, XML, CSV,...; attending different criteria: export/import some properties and not others, transform values in this or that way before exporting/importing,...; and all of this without having to change the class definition? Wouldn't that be great??

Well, perhaps it's a goal too ambitious to reach 100% but, exploring this idea, I've developed a bunch of classes that I thought it was good to share. If you want to test, change, modify or improve the code, or just take a look at it, you can do it here. There you'll find a more detailed explanation (see Readme.md)

Be aware, this is a proof of concept for myself done in spare times, sure it's not robust enough or it can be done much better... but, I was just playing...ok, I could just wait to the new JSON Adaptor (coming soon!) that sure is going to resolve much more scenarios in a cleaner way, but... meanwhile... :-) ...
4
4 2796
Question Akshat Vora · Feb 22, 2020

I need to convert an array with an unknown number of indices to a JSON string for transmission (which is why it isn't possible to iterate through it using $ORDER). Does ObjectScript provide functionality to convert an array to a JSON string?

Edit 1: As Joel mentioned, the array is subscripted and has an arbitrary structure like:

a(1)="a"
a(3,4)="b"
a(3,6)="c"
a(5,6,7)="d"

which needs to be converted to

{"1":"a", "3":{"4":"b","6":"c"}, "5":{"6":{"7":"d"}}}
6
0 1889
Question Akshat Vora · Jan 21, 2020

I need to convert a JSON payload to a custom object type. Currently, I'm converting the JSON object to a %Library.DynamicObject object and need to proceed from here.

As of now, these are my options

                 1. Using an external library talked about in this link:

https://community.intersystems.com/post/binding-regular-cache-object-dynamicobject-and-vice-versa

Downside: Could be buggy (as admitted by the creator) + some other design concerns brought up in its the discussion thread

4
1 1165
Question Nael Nasereldeen · Dec 10, 2019

Hi,

The class %JSON.Adaptor is very convenient,

I wonder if anyone faced the following scenario using it-

Exporting an object, that has a many to many relationship, and getting the details of the related objects.

For example, if we have three classes - Teachers, Students, and an intermediate class TeacherStudent .

The classes extend %JSON.Adaptor, and we would like to open a Student object, use %JSONExport, and get a JSON

That  includes the details of the student and all the teachers that teach the student, something like:

6
0 615
Question Michael Davidovich · Dec 3, 2019

I am writing an API that sends over a very large JSON object. 

The code I'm using to get the data is actually used in our production system today for the use of writing a report.

However when I call the code using the API (using SoapUI) I am getting 'Error getting response; java.net.SocketTimeoutException: Read timed out'

The web applications settings have a session timeout setting at 15 minutes, but this is timing out within just a few minutes, so I know it's not hitting this mark.

3
0 412
Article Peter Cooper · Mar 13, 2018 3m read

Index to Articles

Hi All

I am an avid user of ZEN for over 10 years now and it works for me.
But it seems that Intersystems are no longer actively developing it (or ZEN Mojo), the only published reference to this  is here

As an aside, Intersystems makes fine products (I have been using the technology for 35 years) and has great support BUT they are not good at being open with their product road map/retirement plans.  This is very embarrassing  to me when talking with my end user clients.

10
1 2077
Question Larry Pinsky · Oct 21, 2019

I have a text file that I pick up in a Business Service and need to send it to our vendor via JSON.  I assumed (probably wrongly) that I could just create a RESTful Business Operation, plug in the server IP and URL as well as complete some of the other fields on the BO to send the file.  When I do this, I get the following error:

4
0 935
Article Peter Cooper · May 10, 2018 3m read

Index to Articles

Published 2018-05-11 Last edit -

Hi All

I this article I detail some strategic issues that a new development UI will need to address - these are the ones that I can think of now - others may come to light during this journey.

See the webinar by Eduard Lebedyuk here from the last Global Summit describing  modern web development and Caché

And, as always, if I have missed something please comment....

13
2 1641