Why when i pass to this function a string like this
{ "id": 50445, "message": "", "session": "_57J11K9FN", "status": 0 }
i receive an object where i have no id property but only the other three ? Is "id" a reserved key ?
Not sure but that works for me:
DO wwjsonserializer
lcJson = '{ "id": 50445, "message": "", "session": "_57J11K9FN", "status": 0 }'
loSer = CREATEOBJECT("wwJsonSerializer")
loResult = loSer.DeserializeJson(lcJson)
*** 50445
? loResult.Id
There should be no reserved words for deserialized objects other than illegal FoxPro property names (ie. starts with a number, any sign characters other than _
etc.).
Is it possible you have an old or mismatched copy of wwDotnetBridge? This might explain your other issue as well.
+++ Rick ---
Reinstalled Web Connection. It seems to work...
Does that fix both of the problems?
Just FYI - I don't change wwDotnetBridge and the support pieces often but they do change from time to time, so always make sure you're using a matched set of PRG -> DLLs. If the DLL interfaces change weird stuff can happen as you apparently found out.
+++ Rick ---
It solved only this problem.... The serialization problem explained in other message is not still solved.... I'm still trying to understand why i have it... If you remember i received null values if i pass to Serialize function an object like ThisForm.oObject I create a sublevel methods in my class form where i make this operation
Lparameters lvValue
Do Case
Case Type("lvValue") = "O"
lvSerial = CreateObject("Empty")
lnConta = AMembers(aProps,lvValue)
For ii=1 To lnConta
lcField = "lvValue." + aProps[ii]
AddProperty(lvSerial,aProps[ii],&lcField)
EndFor
Otherwise
lvSerial = lvValue
EndCase
lcJson = This.oSer.Serialize(lvSerial)
Return lcJson
Where i receive the original object and i transform it into another one and it works.... why i don't know.... for the moment i use it in this way.....
Hmmm... that doesn't make any sense to me. An object is an object, unless there's a scope issue. Could it be that the properties on this object are protected or private so that they are not visible once they enter the context of the Serializer object?
Did Thierry's advice help setting a breakpoint and looking at the call stack? That should show you exactly where the values are getting lost as you can examine the state up the call stack.
+++ Rick ---