Question
· Jul 25

Read an XML response

I receive response from Business Operation(HTTP GET) as below :

<response>
<message_code>202</message_code>
<message_string>Success/message_string>
</response>

I am not able to read the "message_code" as response.message_code ?
is it because of underscore ?
Is there a way to read it ?

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

Assuming  that response.message_code is part of an ObjectScript expression then you want to evaluate response."message_code" because _ is an ObjectScript operator so you must quote "message_code" to change it into a method or property name.  Otherwise, _ is the string concatenation operator so the value of response.message will be concatenated with the value of code.