Hello Jayanga,

On Wed, Apr 30, 2014 at 2:25 PM, Jayanga Dissanayake <[email protected]>
 wrote:

> exceptions.ScriptException: org.mozilla.javascript.EvaluatorException:
> Compilation produced 1 syntax errors.


This is a syntax error. I'm assuming responseMessage a bunch of XML. XML
will be treated as a string in this context. Hence, you can't traverse it
with these operators. You'll have to parse it to be a Javascript object.

Have you tried parsing it with XML utility for jaggery [1]?

[1] http://jaggeryjs.org/documentation.jag?api=xml

Cheers,
Nadeesha.


On Wed, Apr 30, 2014 at 2:25 PM, Jayanga Dissanayake <[email protected]>wrote:

> Hi All,
>
> I was trying to get the response from WSRequest as a responseE4X. This
> returns the actual response received [1]. But the contents of the response
> cannot be accessed [2].
>
> [1]
>
> <ns:commandResponse xmlns:ns="http://org.wso2.carbon.oc.services/agent";>
>
> <ns:return>{"ocMessageName":"CommandMessageResponse","ocaToken":"e9f73475-34ad-494b-83be-ccb415176efb","command":"restartGracefully","status":"RESTARTING"}</ns:return>
> </ns:commandResponse>
>
> [2]
>
> 2014-04-30 14:24:13,241]  INFO {JAGGERY.api.update:jag} -  Updating...
> js: "/operation_center/api/action/control_command.jag", line 43: missing )
> after argument list
> js:     log.info(responseMessage.ns:commandResponse.ns:return.toString());
> js: ................................^
> [2014-04-30 14:24:15,545] ERROR
> {org.jaggeryjs.scriptengine.engine.RhinoEngine} -
> org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.mozilla.javascript.EvaluatorException: Compilation produced 1 syntax
> errors. (/operation_center/api/action/control_command.jag#1)
> [2014-04-30 14:24:15,545] ERROR
> {org.jaggeryjs.jaggery.core.manager.WebAppManager} -
> org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.mozilla.javascript.EvaluatorException: Compilation produced 1 syntax
> errors. (/operation_center/api/action/control_command.jag#1)
> org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.mozilla.javascript.EvaluatorException: Compilation produced 1 syntax
> errors. (/operation_center/api/action/control_command.jag#1)
>
>
> Regards,
> *Jayanga Dissanayake*
> Senior Software Engineer
> WSO2 Inc. - http://wso2.com/
> lean . enterprise . middleware
> email: [email protected]
> mobile: +94772207259
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Nadeesha
@ncthis
0779094280
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to