Code: Select all
{
"operation": {
"result": {
"message": "Request details added successfully.",
"status": "Success"
}
}
}
Code: Select all
Define_Com Class(#XPRIM_RandomAccessJsonReader) Name(#JsonRandomAccessReader)
Define_Com Class(#XPRIM_ErrorInfo) Name(#JsonErrorInfo)
#JsonRandomAccessReader.SetSourceHttpResponse Httpresponse(#HttpRequest.Response) Errorinfo(#JsonErrorInfo)
#JsonRandomAccessReader.BeginObjectWithName( "result" )
#oErrorCode := #JsonRandomAccessReader.ReadStringWithName( "status" "" #STD_TEXT ).AsNativeString
#JsonRandomAccessReader.EndObject
I was able to make this work by using #JsonRandomAccessReader.ReadStringWIthPath( 'operation/result/status' '' #STD_TEXT ).asNativeString instead but would like to understand why the ReadStringWIthName code did not work.
Thank you in advance for any information.