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:

0 6
0 442

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.

0 3
0 284
Question
· Oct 21, 2019
How to send a file via JSON

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:

0 4
0 724

Good morning -

I am attempting to pass some HL7 content (say, a complete ADT message) from one server to another via REST/JSON - for reasons.

I can get the data across but when I try to create an EnsLib.HL7.Message object from the message in the JSON body, I end up with just the start of an HL7 msg in the resulting object. Looks like: MSH|^~\&

The start of the code accepting the data looks like this:

0 3
0 840

Hello community,

I am trying to parse the below HttpResponse in Cache. Cannot get the Iterator to work. Is there a single loop which can parse both or single messages and grab the error?

{
error:[
{ txt1:'error msg1'},

{ txt2:'error msg2'},
]
}

{
error: {
txt1:[
'error msg1',

'error msg2'
]
}

Thanks,

Jimmy Christian

0 16
0 2.1K

I am still new to cache objectscript and am trying to figure out how I would go about removing the escape characters from my JSON below. When I call the $toJSON method it's adding the "\" character in the file path.

{"FileStatus":"P","Path":"\/somepath\/test\/test123\/filename.txt","InterchangeOID":"100458"}

My Code:

0 11
0 9.7K

Referencing this post:

https://community.intersystems.com/post/producing-json-sql

I'm not sure how to actually interact with the result set I get from doing something like this. I want to return something like:

[{"field1":1, "field2":2}, {"field1":2, "field2":10}]

I'm finding it very difficult to get it in this format, since %Print appends a newline onto the end of the {} object it prints.

Here's the closest I've gotten:

1 5
3 1.2K

Dear Colleagues and Friends,

is there any indication that the .NET object representation of Cache objects (i.e. InterSystems.Data.CacheClient.dll) complies with .NET Standard? I'm planning to extend our existing .NET client/server solution with a mobile option by Xamarin Forms and can't find any significant hints in the internet.

I'm just fooling around a bit and made some expreiments with a REST API and a generic object-to-JSON tier:

0 1
0 350
Question
· Mar 7, 2019
JSON challenge

Hello folks,

I have an JSON object that need to be updated before being parsed into a JSX component.

Source JSON obj:

var Obj = { "data": [
  {"id":1, "text":"Task #1", "project":"10", "sub_project":"10-1" },
  {"id":2, "text":"Task #2", "project":"10", "sub_project":"10-1" },
  {"id":3, "text":"Task #3", "project":"11", "sub_project":"11-1" },
]};

Required JSON obj result:

0 1
0 373

Hi All,

I am trying to get JSON data from a REST api. I am using my web browser to get the data by hitting the URL.

The data is receiving properly, but the JSON contains a few HTML tags.

These tags are not not receiving in the browser while hitting the url. Is there any way to overcome this issue ?

Thanks,

0 2
1 462