At the moment, the Royale variant of RemoteObject is not really supported. Use
MX:RemoteObject for now as it is complete and tested. I believe js:RemoteObject
needs more work/testing and is not ready for public use.
Switching may resolve your issue.
Also, I don’t believe you need to register ArrayList to ArrayList. At the
moment, at least with Blaze 3.x, you need to alias ArrayCollection to ArrayList
as lists are deserialized to ArrayCollections, and need to be treated as
ArrayLists:
// Treat ArrayCollection locally as Royale ArrayList
registerClassAlias("flex.messaging.io.ArrayCollection", ArrayList);
From: [email protected] <[email protected]>
Sent: Tuesday, June 15, 2021 12:52 PM
To: [email protected]
Subject: [EXTERNAL] Re: Error using js:remoteObject
I found the solution.
The mistake I made was with the method. I fixed it here
service.send("getContacts", []);
This source was helpful.
https://github.com/apache/royale-asjs/blob/develop/examples/royale/RemoteObjectAMFTest/src/main/royale/App.mxml
Thanks everyone.
On Tuesday, June 15, 2021, 12:17:11 PM GMT+1,
[email protected]<mailto:[email protected]>
<[email protected]<mailto:[email protected]>> wrote:
I am trying to call my blazeds service from royale.
Trying to follow the guidelines specified here
https://apache.github.io/royale-docs/features/loading-external-data/remoteobject
I get the following error:
[onFault]
AbstractMessage.readExternal
Language.as:254 ReferenceError: Error #1056: Cannot create property faultDetail
on flex.messaging.messages.ErrorMessage
Language.as:254 ReferenceError: Error #1056: Cannot create property faultCode
on flex.messaging.messages.ErrorMessage
Language.as:254 ReferenceError: Error #1056: Cannot create property faultString
on flex.messaging.messages.ErrorMessage
Language.as:254 ReferenceError: Error #1056: Cannot create property rootCause
on flex.messaging.messages.ErrorMessage
Language.as:254 ReferenceError: Error #1056: Cannot create property
extendedData on flex.messaging.messages.ErrorMessage
Code snippets are as follows
trace(" -- registerClassAlias for royale array list -- ");
registerClassAlias('org.apache.royale.collections.ArrayList', ArrayList);
The above was registered at the main application.mxml.
<j:beads>
<js:ApplicationDataBinding />
<js:RemoteObject id="service"
endPoint = "http://localhost:8080/messagebroker/websocket-amf"
destination = "contactService"
result="onResult(event)" fault="onFault(event)"/>
</j:beads>
trace(" about to call contactService.getContacts ... ");
service.send("contactService.getContacts", null);
private function onResult(param0:ResultEvent):void
{
trace(" -- onResult oh ! -- ");
}
private function onFault(param0:FaultEvent):void
{
trace(" -- onFailure oh ! -- ");
var errorMessage : String = param0.message as String;
trace(" Error :: " + errorMessage);
trace("[onFault]", param0);
}
I am using jewel.
I am tested my blazeds end point using the java amf client. It works fine. This
is my first attempt at calling a blazeds end point from royale.
Any ideas ?