Hi Nadeesha,

Thanks for the reply. I checked the type of the object, its an XML object.
There was a bug in the code which I originally posted. Then I fixed [1]. It
solve the syntax error. but it failed in execution [2]

[1]

log.info(responseMessage.ns::commandResponse.ns::return.toString());

[2]

js: "/operation_center/api/action/control_command.jag", line 44: missing
name after :: operator
js:         log.info
(responseMessage.ns::commandResponse.ns::return.toString());
js: ...............................................................^
[2014-04-30 17:55:25,943] 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 17:55:25,943] 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.

*Jayanga Dissanayake*
Senior Software Engineer
WSO2 Inc. - http://wso2.com/
lean . enterprise . middleware
email: jaya...@wso2.com
mobile: +94772207259


On Wed, Apr 30, 2014 at 5:33 PM, Nadeesha Cabral <nadees...@wso2.com> wrote:

> Hello Jayanga,
>
> On Wed, Apr 30, 2014 at 2:25 PM, Jayanga Dissanayake <jaya...@wso2.com>
>  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 <jaya...@wso2.com>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: jaya...@wso2.com
>> mobile: +94772207259
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Nadeesha
> @ncthis
> 0779094280
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to