Hello,
We are trying to update an enum attribute of an object.
We have tried two ways, using an OID and the value of the enum object
When using the OID, the update works however we get the JSON format errors in the log and 500 error response.
When using the value, we get access denied error.
Details of request/response below.
Can you please provide guidance on best mechanism to be used?
OID Method
- First retrieve the OID by reading the desired enum object and then use to set the value
Request:
<pre class=”lang:java decode:true crayon-selected”>{
“$class”: “Address”,
“$oid”: “10B49BB34CDD1449A8842A18441316579C”,
“countryValue”: {
“$class”: “Country”,
“$oid”: “4341474F42656E4853434F554E545259”
}
}
Response:
2019-06-06 13:15:04,849 ERROR [nexj.core.rpc.json.JSONHTTPServer] (ajp-nio-0.0.0.0-8009-exec-31:/nexj http:11111111 nexjsa) Error processing the JSON request (reference id omnijl)
java.lang.NullPointerException
at nexj.core.rpc.http.RESTHTTPServer.invoke(RESTHTTPServer.java:484)
Value method:
<pre class=”lang:java decode:true “>{
“$class”: “Address”,
“countryValue”: {
“$class”: “Country”,
“value”: “CAN”
}
}
Response/error:
{
“$message”: “Access denied to an instance of class \”Country\”.”,
“$code”: “err.runtime.access”,
“$arguments”: [
“Country”
]
}