Good Morning! How can I use the method Rewind() to read a file JSON?
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.
Good Morning! How can I use the method Rewind() to read a file 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:
ERROR <Ens>ErrException: <PROPERTY DOES NOT EXIST>zOnMessage+5^EnsLib.HTTP.GenericOperation.1 *HTTPHeaders,Ens.StreamContainer -- logged as '-' number - @' Set tHeaderKey="" For { Set tHeaderKey=pRequest.HTTPHeaders.
Hello,
I am taking some intro lessons in REST from the online courses. Below is a very simple code i wrote. But when i try to see the output by entering the url
http://localhost:57773/rest/coffeemakerapp/coffeemaker i get an error "
If the problem continues, contact the site owner.
HTTP ERROR 401
Thanks,
Jimmy
Class demo.CoffeeMakerRestServer Extends %CSP.REST { XData UrlMap [ XMLNamespace = "http://www.intersystems.
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é
Hello again and welcome to the next tutorial on this series: Part 5 - Errors. Here we are going to learn how Frontier handles unexpected errors and how we can force them.
%ToJson doesn't work in 2015 release of cache, How to transform a object to json in this release ?
Hi Community!
We are pleased to invite you to the upcoming webinar in Spanish "Desarrollar y gestionar APIs con InterSystems IRIS Data Platform" / "Developing and managing APIs with InterSystems IRIS Data Platform" on October 15 at 16:00 CET!
Are you a backend developer? Or a Systems integration specialist? If so… this webinar is for you!
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:
S tInput = tReq.Message
S tMsg = ##class(EnsLib.HL7.Message).%New()
D tMsg.ImportFromString(tInput)
S tMsg.DocType = "2.3.
Hi Everyone!
New video, recorded by @Stefan Wittmann, is already on InterSystems Developers YouTube:
JSON and XML persistent data serialization in InterSystems IRIS
I got below error when passing Date in timestamp format.
I am using %JSON.Adaptor. Please refer screen 2
.png)
.png)
.png)
Some time ago, InterSystems introduced the concept of %DynamicObjects.
This feature is a powerful tool that makes it very easy to convert any string of JSON text to objects and vice versa.
However, in the work that J2 Interactive is doing for our customers, there are a couple of things that "need some tweaking".
Very often, we create REST services for our customers. Those services have a payload (in JSON format) that contains information that our customer expects in the form of an object that is proprietary to them.
Hi Team,
I am using %JSON.Adaptor class for Json validation.
Using below statement I got only one required field validation.(refer below screen)
SET stat = objExternalUser.%JSONImport(%request.Content)
I need summary of all required field.
.png)
.png)
Hi Community!
Enjoy watching the new video on InterSystems Developers YouTube, recorded by @Joel Solon, InterSystems Senior Technical Trainer:
Hi Community!
You're very welcome to watch a new video on InterSystems Developers YouTube, recorded by @Stefan Wittmann, InterSystems Product Manager:
InterSystems API Manager Introduction
Over the next few months I will be releasing a number of open source libraries and tools to the Caché community.
Most of the code has evolved from previous production grade solutions over the years and I am collating it together under a single overarching library package that I am calling Cogs.
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
Hi all,
I have a class that I want to serialize to JSon. So I'm using the object %ZEN.Auxiliary.jsonProvider)
set myClass = ##class(myapp.myclass).%New() set myClass.property1 ="value 1" set myClass.property2 = "value 2" set myClass.property3 = "value 3" do ##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(.tStream,myClass ,,,1,"ed") write tStream.Read()
By definition of myclass, all properties are serialized, that's fine. But I want not serialize the property3. I think is using a XML attribute in the property, or something about. But I didn't find anything about.
The Widgets Direct sample application highlights many aspects of how to use InterSystems technologies to build a modern web application.
Hi Dev Community,
My team is currently working on a project where we need to post pdf documents to a 3rd party REST API.
The API specifies a field in the JSON request message to contain the 'physical content' of the file as an array of bytes, example of the JSON request as follows - data truncated for readability purposes:
{
"CaptureSource":2,
"RecipientID":"ID34",
"Document": {
"Guid":"5D847A4E9CC1485382DC4A5F5DC80D6C",
"EventDate":"2019-01-14T13:23:46",
"FileExtension":"pdf",
"FileContent":"JVBERi0xLjQNCiXi48/TDQoxIDAgb2JqDQogIDw8DQogICA.
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:
set query = "select JSON_OBJECT('field1': field1, 'field2":field2) from MyTable where x=? and y=?"
set tStatement = ##class(%SQL.Statement).%New()
set qStatus = tStatement.
We have a business service that extends
This service polls for json files in a folder.
Method signature is like this:
And inside that method it tries to read the content like this:
if ($$$ISERR(tStatus)) quit
set tJSON = {}.%FromJSON(tData)
I added some trace calls before and after lines and noticed it's always that last line that fails if content is larger than 32kb.
Any workaround for this?
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:
Thanks.
I have two classes:
Class Example.Parent Extends %Persistent
{
Property Name As %String;
Property Description As %String;
Property Children as list of Example.Child;
}Class Example.Child Extends %Persistent { Property Name As %String; Property Description As %String; }
A parent can have many children. I want to query for parents and add children for each parent to my result.
Here is the code that I query with:
Class Example.QueryParents [ Abstract ]
{
ClassMethod QueryParents() As %String
{
Set query = "SELECT %ID ID, Name, Description FROM Example.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:
ClassMethod ObjectFromObject(o As %RegisteredObject, class As %String = "", package As %String = "") As %DynamicObject
{
i class = "" s class = o.
Hello folks,
I have an JSON object that need to be updated before being parsed into a JSX component.
ˮ This is one of my articles which was never published in English. Let's fix it!
Hello! This article is about quite a practical way of developing InterSystems solutions without using the integrated tools like Studio or Atelier. All the code of the project can be stored in the form of "traditional" source code files, edited in your favorite development environment (for example, Visual Studio Code), indexed by any version control system and arbitrarily combined with many external tools for code analysis, preprocessing, packaging and so on.
Hello,
I'm trying to convert JSON response to object in cache 2010.
My Code is bellow:
my JSON response
the result :
Hi Community!
Suppose I have a property in a ObjectScript class:
Property values As list Of %StringWhat an SQL query can help to return the values of the property as JSON array via SQL access (JDBC)?
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,
Hello.
I just noticed that whenever I parse a JSON using %FromJSON, it always return the property values as primary data types, including long strings.
I did a quick stress test to measure it's capabilities and found out that characteristic, this is something I needed to figure out beforehand to implement my REST lib.
What I concluded is that %Dynamic depends solely on volatile storage? What if the user doesn't have long string support enabled or if the server has not enough memory to handle long strings?
Is there a fallback for handling it?