JSON

Syndicate content 17 

Hello everyone,

i already asked this question in another post (https://community.intersystems.com/post/how-can-i-import-my-json-formatt...) and i'm sorry for creating a new post but i still didn't get an answer so i try it again. Now i know how to import my JSON formatted data from my API to my DocDB but now i have the problem that my JSON formatted data from my API is imported only to the %Doc  column and not to the columns that i created with my properties.  I'm not really sure but i think that the document database only puts my information from my API to the right columns if my JSON is in a JSONArrray format. But the format of my API is JSONObject and looks like this

Last answer 11 October 2018 Last comment 5 October 2018
0   0 2
486

views

0

rating

Hello everyone,

i want to create an iris document database with Atelier with some properties, where i can import my JSON formatted data from an API to the database which i created. Right now i know how to import my local JSON formatted data to my created database:

Class User.Classtest

Last answer 4 October 2018 Last comment 7 October 2018
0   0 2
292

views

0

rating

Hi everyone,

I need submit a object have a json string as property of class, but I get an issue, object can't save to SQL table if I take json data to json property. I try making a test class with only json property and get the same issue, no data row in SQL table after run ClassMethod . Some one know what's problem, please help me. Here my test class

Last answer 4 October 2018 Last comment 4 October 2018
+ 1   0 2
219

views

+ 1

rating

404 Not Found

{
"error": {
 "errors": [
  {
   "domain": "global",
   "reason": "notFound",
   "message": "Not Found"
  }
 ],
 "code": 404,
 "message": "Not Found"
 }
}

I want to do something like the above sample from a Google Storage JSON API. I have a call to Write obj.%ToJSON() followed by return ..ReportHttpStatusCode(..#HTTP404NOTFOUND) however the HTTP Status code is always 200.  If I remove the Write obj.%ToJSON() statement it returns a 404 status with no body. How do I return both?

Last answer 19 September 2018
0   0 3
0

comments

239

views

0

rating

Generally speaking, InterSystems products supported dynamic objects and JSON for a long while, but version 2016.2 came with a completely new implementation of these features, and the corresponding code was moved from the ObjectScript level to the kernel/C level, which made for a substantial performance boost in these areas. This article is about innovations in the new version and the migration process (including the ways of preserving backward compatibility).

+ 5   2 1
0

comments

639

views

+ 5

rating

Hi,

we have Angular solution and Cache server. We need to have separate users and sessions on same browser (laptop, table etc) for every user and for one user with many connections.

Thought this was resolved, but unfortunately not.

-----------------------------------------------------------------------------------------------------------------------

I got the code away from here, because it was some how ok.

The session on server mixed, but no any more, thanks our folk and local engineer's tools :)

We had some silly GROUP BY ID %ISCMgtPortal in WebApplication settings and even we had use session Cookie, IE added some cookie., but not any more after they took that setting away.

Last comment 4 September 2018
0   0 1
0

answers

171

views

0

rating

In a EnsLib.REST.Operation I have...

Set tSC=..Adapter.Post(.tHttpResponse,,pRequest.stream)

This sends JSON string over HTTP

I am getting this error back from the server

ErrHTTPStatus: Received non-OK status 415 from remote HTTP server: 'HTTP/1.1 415 Unsupported Media Type'

I have been told that the media type should be "JSON"

how do I go about changing the media-type of the HTTP Request?

Last answer 3 September 2018
0   0 2
0

comments

325

views

0

rating

I'm trying to have my REST service return the entire data set for one of our legacy globals.  Currently I am parsing the object from a SQL statement into generic objects to be returned like this:


         Set specimenArray=[]
        
        WHILE resultSet.%Next() {
            Set specimen = {}
            Set specimen.SpecimenId= resultSet.SpecimenId
            Set specimen.ProjectId = resultSet.ProjectId
            
            Set Oref = specimenArray.%Push(specimen)
        }
        
        Set tProxy = specimenArray.%ToJSON()
        set %response.Status = 200
        set %response.ContentType = "application/json"
        Set %response.CharSet="utf-8"

        Write tProxy

Last answer 23 July 2018 Last comment 23 July 2018
+ 1   0 2
210

views

+ 1

rating

or "Didn't you say you would cover Persistent Objects in Part 5, Chris?"

Yes, that was the plan.  This is a pretty important topic, so it get's its own Article

Up until now, we've display widget JSON that has been created by a basic loop.  Clearly this isn't of much value.  Now we have our stack connected together, and we can see that the data is flowing to the Welcome page, it's time to complete the stack and start feeding our service from "real" data.


Let's start with our (very basic) Persistent class for Widgets.  We have 4 properties to hold Name, Description, Price and current Quantity.  We would like to expose all of these on our page.

Last comment 4 July 2018
+ 2   0 3
749

views

+ 2

rating

Hi everyone,

I am still learning the platform for a student project and have to do some streaming and data analysis next. Since for my case I have no "live api" I wanted to just stream json files and output the data as it comes in from the files. (basically to emulate a incoming data scenario)

So thanks to the documentation and community posts I have figured how to create a stream and read data from a JSON but since I'm also new to JSON I have some parsing problems. I don't know how to access subarrays/sub-objects via objectscript.

The structure of the JSON File, I will omit some data because its large and the "rowset" has much more data

Last answer 3 July 2018 Last comment 4 July 2018
0   0 2
400

views

0

rating

Is it possible to produce a .json format using Ensemble 2015.2.2? Not sure what the trigger will be as of yet, but we have our local Department of Health trying to develop a reporting piece using .json. 

Not sure how this will work with our Ensemble instance not being in the DMZ to send outside our network, but I thought I would ask anyway to see if it is possible.

Thanks

Scott Roth

Last answer 17 May 2018
0   0 3
0

comments

157

views

0

rating

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.

Last comment 11 May 2018
+ 16   0 8
1049

views

+ 16

rating

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... :-) ...

Last comment 26 April 2018
+ 9   3 1
676

views

+ 9

rating

Hi

Made a request for API REST.

Using HTTP Request adapter.

Adapter As EnsLib.HTTP.OutboundAdapter

Outside the Ensemble an API response is JSON (CORRECT)

Answer in Ensemble: =?Á
Â0 
?_eä,cÒ
'=
*^<YÙF¡í$í¼ÈÞÝt 
oÉ÷ý$?|
¤1¡{Dâhà°Ý?Öù)2ós??R?¸¼?ºd?$,ñD+»??

ÔºQZéýNÕ V{C?óò?b¢?éÍ )$ 
²5Å?wEë? ??©tÖã1z×2FëÊnôeË æ??]Zßq ܺ?á

Help me.

Thank you

0   0 3
205

views

0

rating

Hello.

We have a request message with properties that has underscore. This is because we need to convert that request to JSON.

The problem is when we try to assign a value in a Business Process with the editor. It doesn't work, it doesn't compile.

How can we fix this?

This is the object used in the request: 

Class test.msg.struct.TestXML Extends (%SerialObject,%XML.Adaptor)
{
Property "status_id" As %String(MAXLEN = "");
Property service As %String(MAXLEN = "");
}

And this is the error

Last answer 20 April 2018 Last comment 20 April 2018
0   0 2
313

views

0

rating

How to convert SQL persistent classes to JSON output - I have tried 1 option but appears to be very lengthy process.

I have many other SQL storage's defined and have to expose them as well to JSON. Can anyone please suggest a better approach.

My column names usually match with my Json properties.

My User.TestClass is the class with GetJsonList() as my method to return /output JSON formatted data.

The Code tried and SQL storage structure are as follows -

Last answer 19 April 2018 Last comment 18 April 2018
+ 1   0 3
363

views

+ 1

rating

I've been trying to interoperate with careevoltion using their backend-services.
Spec: http://docs.smarthealthit.org/authorization/backend-services/

This involves creating a JWT (JSON Web Token) that I have been unable to do using %OAuth2.JWT:ObjectToJWT.

I downloaded jwt.pfx and then ran the following openssl commands to create some pem files.

openssl pkcs12 -in jwt.pfx -out file.nokey.pem -nokeys
openssl pkcs12 -in jwt.pfx -out file.withkey.pem

openssl rsa -in file.withkey.pem -out file.key

cat file.nokey.pem file.key > file.combo.pem3

I then ran some node code to create the private portions of the RSA key

Last answer 19 January 2018
0   0 2
295

views

0

rating

most of my jSON data is single words, but when it comes to sending chunks of a memo/email via JSON, that totally different

which is the correct conversion process to prepare data ready to insert into the data part of a JSON string so that all problem characters are converted

JSON of course crashes if you use the wrong format of quotes (single or double) and you ned up having to use &QUOT and \' to get around that but is there a simple call to something that will just take care of preparing the data from the JSON string both on the inward and outward part of JSON

kevin

Last answer 16 March 2018 Last comment 17 March 2018
0   0 3
201

views

0

rating

This series of articles aims to address the following topics:

  • Creation of a web application based on REST pages;
  • Overview of some tools for tracing (debugging) HTTP requests;
  • Switching from hyperevents to... hyperevents;
  • Integration with jQuery File Upload;
  • Conversion of JSON from the {id:1,parentId:1} format to the {id:1,children:[{}]} format for tree visualization;
  • Integration with jQuery EasyUI (using datagrid and tree as examples);
  • Other topics.

Last comment 8 March 2018
+ 4   0 3
527

views

+ 4

rating

(I am new to this language) I have got a JSON request to handle in a web application which is in %CSP.Request object. But the request which I am going to handle is of type array of objects.
like,

[
  {
    "Name": "bat"
  },
  {
    "Name": "Cat"
  },
  {
    "Name": "rat"
  },
  {
    "Name": "mat"
  },
  {
    "Name": "hat"
  },
  {
    "Name": "chat"
  },
  {
    "Name": "please"
  },
  {
    "Name": "help"
  },
  {
    "Name": "me"
  },
  {
    "Name": "in"
  },
  {
    "Name": "getting"
  },
  {
    "Name": "the"
  },
  {
    "Name": "value"
  },
  {
    "Name": "of"
  },
  {
    "Name": "nameFromObjectInsideArray"
  }
]

my requirement is, i need to extract the value from the " Name " property which is an array of objects.

Last answer 16 January 2018 Last comment 17 January 2018
0   0 4
609

views

0

rating