Hi Jim,

Thanks for suggestion, but I now have everything running in the same domain, so no more CORS problems.

I have continued checking Royale RemoteObject. It certainly looks as though it sends the right data, and the CF log shows the data is received, but CF fails with a Null Pointer Exception at coldfusion.filter.ComponentFilter.normalizeParamTypeForAjax(ComponentFilter.java:297)

I don't know anything about Ajax, but perhaps this means the request header needs some Ajax info. Does anyone know anything about Ajax?

Doug


On 07/06/2022 16:53, Jim McNamara wrote:
Hi Doug-

I have  a suggestion. If I am understanding it right why don't you try the CORS 
plug-in. I think it is for Chrome or maybe edge.

I used it when I got a cross policy error when I fooled around with the Vue.js 
framework.

If that is all that it is...

thanks,
jim (robo-loki)






On Monday, June 6, 2022, 11:26:28 PM EDT, Doug Simmons <doug777...@gmail.com> 
wrote:





Hi All,

Many thanks for all the suggestions. I will give them a try.

Surely though, the best solution is to get Royale RemoteObject working 
properly, unless anyone is aware of some fundamental reason why it can't. I'm 
happy to take a look at any relevant source code to see if I can devise a fix 
at least for CF. It wouldn't be quick as I will shortly be away for nearly two 
months. But if there is no time constraint, I'm happy to try.

Doug




On 07/06/2022 05:18, Alina Kazi wrote:


Hi Doug,




I have used mx:RemoteObject in several applications.

Remote Object in declaration block of mxml file

<mx:RemoteObject id="EPSObj" destination="{RODestination}" endpoint="{ROEndpoint}" 
showBusyCursor="true" source="{ROSource}">

Responder and fault handlers I have added using AsyncTolen and Responder.




var responder680:Responder = new Responder(on_sel_ScanDocTypeCd_SimpleRH, 
ROFaultHandler);

  var token680:AsyncToken = 
EPSObj.sel_ScanDocTypeCd_Simple((FlexGlobals.topLevelApplication as 
IEPS).getAppUserInfo(true)); token680.addResponder(responder680); 
trace(token680);







In some cases I have created the RemoteObject in actionscript class too and it 
works fine.

In the above case the Result handler is: on_sel_ScanDocTypeCd_SimpleRH

And fault handler is :

ROFaultHandler





Hope that helps.




-Alina Kazi





On Tue, 7 Jun 2022, 2:02 am Maria Jose Esteve, <mjest...@iest.com> wrote:


Have you tried mx:RemoteObject?

Hiedra


De: Doug Simmons <doug777...@gmail.com>
Enviado el: domingo, 5 de junio de 2022 6:38
Para: users@royale.apache.org
Asunto: Royale RemoteObject with ColdFuaion



Hi,

Apache Royale Remote Object API says it is suitable for use with ColdFusion, 
but I can't get it to work.

In a Flex (AIR) project I have :

<s:RemoteObject id="roWeDates" destination="ColdFusion" 
source="charts.PCWEDates">
     <s:method name="getmonthdates" result="roWEDatesResultHandler(event)" 
fault="roFaultHandler(event)"/>
</s:RemoteObject>

this.roWeDates.getmonthdates(this.yearChooser.selectedItem, 
this.monthChooser.selectedIndex + 1);

and it all works perfectly.

Now I need to get this working in a browser.

So I have SDK Apache Royale 0.9.9 (JS only) (Bundled)

<js:RemoteObject id="roWEDates" destination="ColdFusion" 
result="roWEDateResultHandler(event)" fault="roFaultHandler(event)"
             endPoint="http://localhost:8500/charts/PCWEDates.cfc"/>

this.roWEDates.send("getmonthdates", [this.yearChooser.selectedItem, 
this.monthChooser.selectedIndex + 1]);

This compiles correctly and then when you run it and send to the CF method : -

No data is returned from CF and neither result or fault handlers are triggered.

The browser log shows :

POSThttp://localhost:8500/popcharts/PCWEDates.cfc         [HTTP/1.1 302 Found 
972ms]

destination fault handler
Object { code: -1005, message: "Invalid response.", detail: "", data: null }    
            Language.js:280:22

I have tried with flex2gateway in the cfc url, but this causes a CORS preflight 
error.

Does anyone have a solution?

Doug








Reply via email to