· Dec 9, 2016

access object in a JSON array.


I am working with this Ensemble Business Operation, which extends the EnsLib.Rest.Operation.

I built the OpenWeatherMap Rest Operation described in the article above.

I would like to access the weather.main, and weather.description. However, these objects are in a JSON Array.

How do you access these three objects in Objectscript.

In my,  Test.REST.WeatherOperation class, I added these three lines.

            set pResponse.WeatherId =
            set pResponse.WeatherMain =
            set pResponse.WeatherDescription =

Also, in my Test.REST.WeatherResponse, response message class I added these three lines.

Property WeatherId As %String;
Property WeatherMain As %String;
Property WeatherDescription As %String;

I get this error, with the code I have.


Thanks in Advance.

Discussion (3)0
Log in or sign up to continue

<PROPERTY DOES NOT EXIST> means your code is trying to reference a class property that does not exist.  The rest of the error message should tell you which property you tried to reference that didn't exist.

After you added those 3 properties to the WeatherResponse class, did you save and compile it?

If you're not able to resolve this, can you post the complete error message?  What property is it telling you doesn't exist?