PILAR GUERRERO · Feb 6, 2019 go to post

Hello,

Can I see how to make the call?
I need to make a similar call and I can not find how to do it.

Thanks!

PILAR GUERRERO · Jul 24, 2018 go to post

Hello, I restarted the instance and then compile the class producction. And now It's working.

PILAR GUERRERO · May 14, 2018 go to post

Hi,

You can do it as in any CSP page/class. With %request, which is object of class %CSP.Request

And headers available in property CgiEnvs, where every http header appear with a prefix HTTP_

try that better

set login = %request.GetCgiEnv("HTTP_LOGIN")
PILAR GUERRERO · Mar 21, 2018 go to post

Hello,

I have the same problem and I can't resolve this... 

I try the solutions but it's not working.

PILAR GUERRERO · Feb 19, 2018 go to post

If you have:

set json = "{""name"":""Sara""}"

You can get the data stored :

set dynObj = ##class(%DynamicObject).%FromJSON(json)

write dynObj.name

PILAR GUERRERO · Jul 3, 2017 go to post

Hello,

i'm asking about positive number beacause when I try, for example:

<?xml version="1.0" encoding="UTF-8"?>
<MsgFile Language="en">
  <MsgDomain Domain="asd">
    <Message Id="100" Name="ErrorNumber">Message about some error number</Message>
    <Message Id="b" Name="ErrorName2">Message about some error 2 %1 %2</Message>
  </MsgDomain>
</MsgFile>

And then I use the terminal, but this doesn't work in the same way as letters or negative number..

>Write ##class(%MessageDictionary).Import("C:\--\CodigosError_20170628.xml")
1
>Set status=$System.Status.Error("100")                                    
>Do $SYSTEM.OBJ.DisplayError(status)                                       
ERROR #100: Código estado desconocido: 100 )
PILAR GUERRERO · Jun 30, 2017 go to post
#dim list As %ListOfDataTypes
##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject("[""a"",""b"",""c""]",,.list)
list.Count(),!
PILAR GUERRERO · Jun 2, 2017 go to post

Ok!

I have been investigating...

I found a approximation that i want to do...

First of all, I want to iterate over JSON and capture de information

set a = "[{""Center"" : ""DKV"",""Nif"" :""00000001T"",""NumberCenter"" :""DKV_1"",""Name"" : ""Nombre_DKV""},{""Center"" : ""Vivisol"",""Nif"" : ""00000002T"",""NumberCenter"" : ""Vivisol_1"",""Name"" : ""Nombre_vivisol"",},{""Center"" : ""Stacks"",""Nif"" : ""00000003T"",""NumberCenter"" : ""Stacks_1"",""Name"" : ""Nombre_Stacks"",}]"
set JSON = ##class(%DynamicAbstractObject).%FromJSON(a) 
set iter = JSON.%GetIterator() 
while iter.%GetNext(.key,.value){write "Center = " _value.Center ,! }

Second i want to put it in my object...  still investigating more about this

PILAR GUERRERO · Jun 2, 2017 go to post

I'm sorry I think that i'm not explain very good. I'll try to do better...

I create a Operation REST API , when I call to my client trough this REST API, my cliente returns list of object in JSON, like that:

[
    {
    "Center" : "aaaaaaaaaa",
    "Nif" : "00000000T",
    "NumberCenter" : "00000000",
    "Name" : "ppppp",
    },
    {
    "Center" : "aaaaaaaaaa",
    "Nif" : "00000000T",
    "NumberCenter" : "00000000",
    "Name" : "ppppp",
    },
    {
    "Center" : "aaaaaaaaaa",
    "Nif" : "00000000T",
    "NumberCenter" : "00000000",
    "Name" : "ppppp",
    }
]

On the other hand, I have in my Ensemble, Two class:

Class A --> lisf of class B

Class B --> Center, Nif,NumberCenter, Name

I need to iterate over JSON and capture de information a put this in my object A

PILAR GUERRERO · May 25, 2017 go to post

Ok! I have just one more question ...

s ret = {}

s  ret.IdClient.= "123"

How can i do something like that ?: 

s  ret.client.name = "peter"

When i try ... <INVALID OREF>

PILAR GUERRERO · May 25, 2017 go to post

Hello,

Firstly, thank for your answer.  I try this method, but my object isn't  %DynamicAbstractObject, for this reason not found using %ToJSON() :-(