Hugo, You are welcome, I'm happy knowing you can go on on Royale :)
The big issue with CORS is that is can fail silently. Some browser
doesn't show issue.
For your case, one of your screenshoot showed "reset session", but no
more... very difficult to know it deals for CORS
Perhaps documentation on using AMF with Apache Royale should be more
warning of this potential issue for dev guys. Regards
Le 03.07.2020 10:41, Hugo Ferreira a écrit :

Hi Fred,

Thank you very much !
It was a CORS issue !
I'm using Google Chrome in debug mode + Charles Web Proxy.

Regards,
Hugo.

<cont...@cristallium.com> escreveu no dia sexta, 3/07/2020 à(s) 08:57:

Hi Hugo,

I'm not sure what is your issue. Did you try to usee developer console
of chrome or firefox (CTRL+MAJ+I) to look at network frames and see
request and server response ?

Do you have a look at :

https://stackoverflow.com/questions/58241175/how-to-use-amfphp-with-apache-royale

and

https://stackoverflow.com/questions/58240043/how-to-disable-cors-on-chrome-when-using-visual-studio-code-and-using-amf-on-apa

Be carrefull that "--disable-web-security" for Chrome is not working
with last Chrome version. So if you dev env is not on same domain as
your service then session will not work

If it may help, here is my Apache Royale code to call remote functions
with AMF :

import mx.rpc.AsyncToken;
import mx.rpc.Responder;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import org.apache.royale.events.EventDispatcher;
import mx.rpc.remoting.RemoteObject;
...

public function ServiceCaller()
{
_ro = new RemoteObject();
_ro.source = "your_service_class_name_to_call";
_ro.addEventListener(FaultEvent.FAULT,onFaultEvent);
_ro.endpoint = _gatewayURL;
_ro.destination = "amfphp";
}
...
To make the call :

public function callService(name:String, listener:Function,
args:Object):void
{

var pos:int =  name.indexOf(".");
if (pos == -1) return;
var ops:Array = name.split(".");
var r:Responder = new Responder(listener, onFaultEvent);
_ro.source = ops[0];
var t:AsyncToken = _ro.getOperation(ops[1]).send(args);
t.addResponder(r);
}

Regards
Fred

Le 03.07.2020 02:11, Hugo Ferreira a écrit :

I'm struggling with RemoteObject (AMF).

Trying to contact from Royale:

https://drive.google.com/file/d/19MQ1yFYxWMPCmPGw-9FsHoHVYmGzG7oh/view?usp=sharing
 Trying to contact from Flex:

https://drive.google.com/file/d/1J2M__rxQzwOayoNr2e96xrmryptxFsne/view?usp=sharing Royale uses GET and Flex uses POST.
I don't know if this is the issue but kept my attention.

This backend is .NET with an implementation of AMF for .NET Standard
however it's working fine for Flex for 7 years.

Reply via email to