So this is a question about this JSON library ?
Your issue is not clear, "everything is null" ? What is null exactly and what are you expecting ?
- www.mql5.com
Correct, it is concerning that library.
The string I receive off the wire and pass to Deserialize is {"MessageType":"Heartbeat","SenderId":"{7CCCD085-CF4F-4778-AB8F-DCB194E903D2}","ReceiverId":null,"Topic":"Heartbeat","SubTopic":null,"timestamp":"1578489397.87759","Text":null}
which I can see in the debug window
when I pass that string to jsn.Deserialize and then view that in the debug window it comes out as
//CJAVal{ group:[7] groupName:"" m_lkey:"" m_parent:NULL m_type:jtOBJ m_bv:false m_iv:0 m_dv:0.0 m_prec:5 m_sv:"" }
whereas I expect something that I can go
int mt = StringToInteger(jsn["MessageType"].ToStr()); if(mt == 3) {
ie reference each node based on its key value..
Correct, it is concerning that library.
The string I receive off the wire and pass to Deserialize is {"MessageType":"Heartbeat","SenderId":"{7CCCD085-CF4F-4778-AB8F-DCB194E903D2}","ReceiverId":null,"Topic":"Heartbeat","SubTopic":null,"timestamp":"1578489397.87759","Text":null}
which I can see in the debug window
when I pass that string to jsn.Deserialize and then view that in the debug window it comes out as
//CJAVal{ group:[7] groupName:"" m_lkey:"" m_parent:NULL m_type:jtOBJ m_bv:false m_iv:0 m_dv:0.0 m_prec:5 m_sv:"" }
whereas I expect something that I can go
ie reference each node based on its key value..
OK it's done by going
string val = jsn.FindKey("SenderId").ToStr();
Thanks for taking the trouble to reply.
Have you read the discussion that goes with the library ?
It seems that more people had the issue with blank key's and found a way to solve it..
- 2015.10.12
- www.mql5.com
Have you read the discussion that goes with the library ?
It seems that more people had the issue with blank key's and found a way to solve it..
Ah, thanks for that link. Appreciated. :)
OK it's done by going
Thanks for taking the trouble to reply.
Quadrant, Hello!
Did it work? Iam trying o read theJson response, but always get null.
CJAVal jv ;
res=WebRequest("POST",uri,NULL,NULL, 5000, post, ArraySize(post),result, result_header);
string dados;
dados = CharArrayToString(result,0,-1);
Print("dados :", dados);
jv.Deserialize(dados);
string mt;
mt = jv ["EA_MAGICO"].ToStr();
Print("EA :", mt);
2020.02.01 10:13:44.816 teste (EURUSD,M15) dados :{"message":[{"MOEDA":"EURUSD","TIMEFRAME":15,"SWAPATIVO":0,"SWAPMOEDA":1,"ALERTA":"True","EA_MAGICO":201900059298,"IDENTIFICADOR_ROB":"EURUSD-15-2.15","ESPERA":500,"META":1000,"PARA":1000,"VALORCORRETAGEM":0,"LOTES":"0.01","AUMENTO1":"True","AUMENT
But I can get the value!! any idea?
Thanks!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I am using ZeroMQ to send messages between MT5 and a bunch of applications I have in C#
I am trying to figure out how to deserialize the data coming off the subSocket in MT5 sent in from my C# component.
The attached file shows the what I am doing.
The raw json strings are being received as shown in the attached image but when I try and deserialize into a CJAVal json object everything is null.
The examples I have found are simples calls to Deserialize and the output shown in the examples is extracting the keys correctly.
in my code mt is obviously zero.
Any clues ?