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" > <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 >