mybe you mean this d ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(SampleJsonData,,.list) ,I tried that but I got an empty list?
in all cases, after doing the below, I should be able at lease read the JSON string but I'm getting an html file, so I'm missing something in my code?
set Httprequest = ##class(%Net.HttpRequest).%New() Set Httprequest.SSLConfiguration="RTLS" Set Httprequest.Server="serverurl" Set Httprequest.Https=1 Set Httprequest.Timeout=30 set Httprequest.ContentType="application/json" Do Httprequest.SetHeader("Accept","text/plain") set Httprequest.Username="user" set Httprequest.Password="password" S stat= Httprequest.Get("someurl")
set Httprequest = ##class(%Net.HttpRequest).%New() Set Httprequest.SSLConfiguration="RTLS" Set Httprequest.Server="serverurl" Set Httprequest.Https=1 Set Httprequest.Timeout=30 set Httprequest.ContentType="application/json" Do Httprequest.SetHeader("Accept","text/plain")
set Httprequest.Username="user" set Httprequest.Password="password" S stat= Httprequest.Get("someurl")
W stat 1
so given the status =1 that means everything went ok isn't if not how can I check?
then I did the following to read the JSON file : Set Resp=Httprequest.HttpResponse.Data.Read()
but when I cheked what's in Resp I get the below html output:
Sorry guys for the delay but it has been a busy week.
basically, this is the query I'm using and attached is a file with the classes used:
Select distinct kc.id,MSDS_UI_Serenity_Report.KitContentMissingType16_FindSerialNo(i.id,kc.id,9237,'00007SV3') As SerialNo, CASE WHEN i.Code IS NOT NULL THEN i.Code ELSE ' ' END As Code, MSDS_UI_Serenity_Report.KitContentType3_GetGroupedName(i.Name,kc.GroupFlag,kc.SubGroupFlag) As InstName, kc.Quantity as Qty,MSDS_UI_Serenity_Report.KitContentMissingType12_GetContentRemarks(k.Loc,k.id,kc.id,'00007SV3') As ContentRemarks, kc.GroupCount As GroupCount, g.Name As grp, MSDS_UI_Serenity_Report.KitContentMissingType16_Getpck(i.id,'00007SV3',kc.Quantity,kc.id,kc.kitId) As pck, MSDS_UI_Serenity_Report.KitContentMissingType15_GetDecon(kc.id,5) As decon, MSDS_UI_Serenity_Report.KitContentMissingType16_GetComments(i.id,kc.id) As Comment, MSDS_UI_Serenity_Report.KitContentMissingType16_GetReason(i.id,kc.id) As Reason, MSDS_UI_Serenity_Report.KitContentMissingType16_GetRemarks(i.id) As Remark From MSDS_Serenity.KitContent kc, MSDS_Serenity.Kit k, MSDS_Serenity.InstrumentGroup g, MSDS_Serenity.Instrument i, MSDS_Serenity.CustomInstrument ci where i.active = 1 and (i.IsImplants is null or i.IsImplants!=1) and kc.instrument = i.id and i.groupid = g.id and k.id = kc.kitid and k.Loc = 5 and k.id = 9237 order by kc.Position,i.Name
although all the fields used are indexed but still this sample query takes around 1 min & 40 sec to generate 48 records and some other queries with more records could take around 10 mins.
I noticed, that most time is consumed and heavy processing is in class calls in the query :
Eg. MSDS_UI_Serenity_Report.KitContentMissingType16_FindSerialNo around 40 sec but I’ve created and built indexes for all used fields (through SMP)!?
Sorry this is just too vague, and sort of result I got from googling around, I'm new to this and I was after a just a quick sample using ensemble objects on how to create a Post HTTP request and where to include my curl, then send the request ..etc
go to post
Nope, changed it to */* and didn't make any diffrence.
in the Token there are "." & "_" special charachters not sure if that cause problem, I tried removed them but still no luck.
go to post
mybe you mean this d ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(SampleJsonData,,.list) ,I tried that but I got an empty list?
in all cases, after doing the below, I should be able at lease read the JSON string but I'm getting an html file, so I'm missing something in my code?
set Httprequest = ##class(%Net.HttpRequest).%New()
Set Httprequest.SSLConfiguration="RTLS"
Set Httprequest.Server="serverurl"
Set Httprequest.Https=1
Set Httprequest.Timeout=30
set Httprequest.ContentType="application/json"
Do Httprequest.SetHeader("Accept","text/plain") set Httprequest.Username="user"
set Httprequest.Password="password"
S stat= Httprequest.Get("someurl")
Set Resp=Httprequest.HttpResponse.Data.Read()
go to post
So I did the following from the Terminal:
set Httprequest = ##class(%Net.HttpRequest).%New()
Set Httprequest.SSLConfiguration="RTLS"
Set Httprequest.Server="serverurl"
Set Httprequest.Https=1
Set Httprequest.Timeout=30
set Httprequest.ContentType="application/json"
Do Httprequest.SetHeader("Accept","text/plain")
set Httprequest.Username="user"
set Httprequest.Password="password"
S stat= Httprequest.Get("someurl")
W stat
1
so given the status =1 that means everything went ok isn't if not how can I check?
then I did the following to read the JSON file :
Set Resp=Httprequest.HttpResponse.Data.Read()
but when I cheked what's in Resp I get the below html output:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>IUDEX</title>
<base href="/" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
<link href="_content/Smart.Blazor/css/smart.default.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
<link href="Galaxy.Client.styles.css" rel="stylesheet" />
</head>
<body>
<style>
.loader-logo {
width: 256px;
}
.loader-container {
flex-direction: column;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
display: flex;
gap: 32px;
height: 512px;
}
.spinner {
border: 5px solid #afafaf;
border-top: 5px solid #e53947;
border-radius: 50%;
width: 32px;
height: 32px;
animation: spin 700ms linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg)
}
100% {
transform: rotate(360deg)
}
}
</style>
<div class="loader-container" id="app">
<img class="loader-logo" src="images/logo-dark.svg" />
<div class="spinner"></div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">ð</a>
</div>
</div>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_content/Smart.Blazor/js/smart.blazor.js"></script>
<script src="_content/Smart.Blazor/js/smart.elements.js"></script>
<script src="_content/Galaxy.DataViewer/canvasjs.min.js"></script>
<script src="_framework/blazor.webassembly.js"></script>
<script src="js/galaxyLib.min.js"></script>
</body>
</html>
I thought I'll be getting a JSON string, FYI I'm supposed to a get a Token in a JSON file?
Thanks
go to post
sorry also set obj = {}.%FromJSON(req.HttpResponse.Data) is not working, is this available in Ensemble 2014?
Thanks
go to post
Hi
Set jsonObject={}.%FromJSON(jsonString) doesn't seems to work and couldn't find %FromJSON in Docs is this available in Ensemble 2014 which I'm using?
thanks
go to post
Thanks
go to post
Sorry guys for the delay but it has been a busy week.
basically, this is the query I'm using and attached is a file with the classes used:
Select distinct kc.id,MSDS_UI_Serenity_Report.KitContentMissingType16_FindSerialNo(i.id,kc.id,9237,'00007SV3') As SerialNo, CASE WHEN i.Code IS NOT NULL THEN i.Code ELSE ' ' END As Code, MSDS_UI_Serenity_Report.KitContentType3_GetGroupedName(i.Name,kc.GroupFlag,kc.SubGroupFlag) As InstName, kc.Quantity as Qty,MSDS_UI_Serenity_Report.KitContentMissingType12_GetContentRemarks(k.Loc,k.id,kc.id,'00007SV3') As ContentRemarks, kc.GroupCount As GroupCount, g.Name As grp, MSDS_UI_Serenity_Report.KitContentMissingType16_Getpck(i.id,'00007SV3',kc.Quantity,kc.id,kc.kitId) As pck, MSDS_UI_Serenity_Report.KitContentMissingType15_GetDecon(kc.id,5) As decon, MSDS_UI_Serenity_Report.KitContentMissingType16_GetComments(i.id,kc.id) As Comment, MSDS_UI_Serenity_Report.KitContentMissingType16_GetReason(i.id,kc.id) As Reason, MSDS_UI_Serenity_Report.KitContentMissingType16_GetRemarks(i.id) As Remark
From MSDS_Serenity.KitContent kc, MSDS_Serenity.Kit k, MSDS_Serenity.InstrumentGroup g, MSDS_Serenity.Instrument i, MSDS_Serenity.CustomInstrument ci
where i.active = 1 and (i.IsImplants is null or i.IsImplants!=1) and kc.instrument = i.id and i.groupid = g.id and k.id = kc.kitid and k.Loc = 5 and k.id = 9237 order by kc.Position,i.Name
usedclassesdef.zip
although all the fields used are indexed but still this sample query takes around 1 min & 40 sec to generate 48 records and some other queries with more records could take around 10 mins.
I noticed, that most time is consumed and heavy processing is in class calls in the query :
Eg. MSDS_UI_Serenity_Report.KitContentMissingType16_FindSerialNo around 40 sec but I’ve created and built indexes for all used fields (through SMP)!?
Thanks
go to post
Thanks
go to post
Sorry this is just too vague, and sort of result I got from googling around, I'm new to this and I was after a just a quick sample using ensemble objects on how to create a Post HTTP request and where to include my curl, then send the request ..etc
Thanks
go to post
I want to use a curl to make a HTTP post request.
thanks