RemoteObject

classic Classic list List threaded Threaded
47 messages Options
123
Reply | Threaded
Open this post in threaded view
|

RemoteObject

Carlos Cruz

Hi

I use RemoteObject extensively to interface with a Java backend, can anyone tell me if RemoteObject is supported in royale ? I tried looking for the example, RemoteObjectAmfTest, mentioned in the emails and forum but I couldn’t find it and I couldn’t find anything on API resource either.

 

Just for FYI I’ve used amfjs library to interface Javascript with a Java backend with BlazeDS and it seems to work well, I was able to send and strings, numbers, objects, arrays and key and value collections.

 

Thx!

Carlos

Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

doug777
Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

Carlos Rovira-2
Hi Carlos,

along with the RemoteObject classes that Doug said you can check the example at :

- Royale client: /royale-asjs/examples/royale/RemoteObjectAMFTest
- Royale java: /royale-asjs/examples/amf/SampleAmfWebApp

I already tried string, numbers, collection with value objects with success, but still didn't try in real app where some last detail problems could emerge.

Please as you use it, let us know if you find any problems and if you find any fill an issue in github

Thanks!


Reply | Threaded
Open this post in threaded view
|

RE: RemoteObject

Carlos Cruz

Thanks Carlos and Doug for the information I will try to get it going and share some preliminary results hopefully by early next week.

 

Another question that pops into my head regarding my project; currently I use “SharedObject” for synchronous communications with Red5 server for our telephony module. Since I’m trying to eliminate the dependency on Red5 I’m contemplating using websockets (html5 or atmosphere), can anyone tell me how I can use WebSockets from Royale?

 

Thx!

Carlos

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Carlos Rovira
Sent: Thursday, November 16, 2017 6:44 AM
To: [hidden email]
Subject: Re: RemoteObject

 

Hi Carlos,

 

along with the RemoteObject classes that Doug said you can check the example at :

 

- Royale client: /royale-asjs/examples/royale/RemoteObjectAMFTest

- Royale java: /royale-asjs/examples/amf/SampleAmfWebApp

 

I already tried string, numbers, collection with value objects with success, but still didn't try in real app where some last detail problems could emerge.

 

Please as you use it, let us know if you find any problems and if you find any fill an issue in github

 

Thanks!

 

 

Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

Alex Harui-2
Hi Carlos,

How to use WebSockets in Royale will depend on how you want to write your code.  If you want to have a functionally equivalent SWF version of your Royale app (a good idea of you used Flex modules), you probably want to create a library that abstracts the SharedObject code on Flash and WebSocket code in JS under some common API.  If you don't need a SWF version of your app, you can just use the WebSocket API if your app is configured to use js.swc instead of playerglobal.swc or airglobal.swc.

HTH,
-Alex

From: Carlos Cruz <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Thursday, November 16, 2017 at 11:15 AM
To: "[hidden email]" <[hidden email]>
Subject: RE: RemoteObject

Thanks Carlos and Doug for the information I will try to get it going and share some preliminary results hopefully by early next week.

 

Another question that pops into my head regarding my project; currently I use “SharedObject” for synchronous communications with Red5 server for our telephony module. Since I’m trying to eliminate the dependency on Red5 I’m contemplating using websockets (html5 or atmosphere), can anyone tell me how I can use WebSockets from Royale?

 

Thx!

Carlos

 

From: [hidden email] [[hidden email]] On Behalf Of Carlos Rovira
Sent: Thursday, November 16, 2017 6:44 AM
To: [hidden email]
Subject: Re: RemoteObject

 

Hi Carlos,

 

along with the RemoteObject classes that Doug said you can check the example at :

 

- Royale client: /royale-asjs/examples/royale/RemoteObjectAMFTest

- Royale java: /royale-asjs/examples/amf/SampleAmfWebApp

 

I already tried string, numbers, collection with value objects with success, but still didn't try in real app where some last detail problems could emerge.

 

Please as you use it, let us know if you find any problems and if you find any fill an issue in github

 

Thanks!

 

 

Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

coxfrederic
In reply to this post by Carlos Rovira-2
<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>
               
        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>
       
        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"
                                                 endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta" source="Meta" />
        </js:beads>
       
    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

Alex Harui-2
Frederic,

First try the example and see if it works for you.

Thanks,
-Alex

On 1/11/18, 6:08 PM, "coxfrederic" <[hidden email]> wrote:

><?xml version="1.0" encoding="utf-8"?>
>
><js:Application
>xmlns:fx="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2F
>ns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7Cd2a52573481
>246bf83f108d5596167cf%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6365131
>97241678407&sdata=nutBqftmr757Oj1lZYmBqqp0C4%2FXPXdryh4oQ4Lv%2BjM%3D&reser
>ved=0"
>                   xmlns:js="library://ns.apache.org/royale/basic" >
> <fx:Script>
>
> </fx:Script>
>    <js:valuesImpl>
>        <js:SimpleCSSValuesImpl />
>    </js:valuesImpl>
>
> <js:beads>
> <js:ClassAliasBead />
> <js:RemoteObject id="amfTestService"
>
>endPoint="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2F
>winkelbeheer.cityfashion.be%2Famfphp%2Fgateway.php&data=02%7C01%7Caharui%4
>0adobe.com%7Cd2a52573481246bf83f108d5596167cf%7Cfa7b1b5a7b34438794aed2c178
>decee1%7C0%7C0%7C636513197241678407&sdata=JOL88Cb4qcfLYrZUtxibBsZBKKL5pdmX
>JlT%2FES5ud%2FE%3D&reserved=0"
> destination="Meta" source="Meta" />
> </js:beads>
>
>    <js:initialView>
>        <js:View>
> <js:VGroup>
> <js:Label id="statusLabel" text="Hello World!" />
> <js:TextButton text="Get AMF data"
>click="textbutton_clickHandler(event)" />
> </js:VGroup>
>        </js:View>
>    </js:initialView>
></js:Application>
>
>
>Any idea why I'm not getting a fault nor success event on this?
>
>
>
>--
>Sent from:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-roy
>ale-users.20374.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7Cd2a52
>573481246bf83f108d5596167cf%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>36513197241678407&sdata=h31z3qgccQhh%2BB6noV9kmSwDXOUOc%2Bd54BTowqHpe0A%3D
>&reserved=0

Reply | Threaded
Open this post in threaded view
|

RE: RemoteObject

Carlos Cruz
In reply to this post by coxfrederic
I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.

-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>
               
        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>
       
        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"
       
endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>
       
    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

coxfrederic
Script tag was stripped from the post:

import org.apache.royale.events.MouseEvent;

import org.apache.royale.net.events.FaultEvent;

import org.apache.royale.net.events.ResultEvent;

protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

{

statusLabel.text = "calling.......";

amfTestService.addEventListener("fault", amfTestService_faultHandler);

amfTestService.addEventListener("result", amfTestService_resultHandler);

amfTestService.send("getShippingMethods", []);

}

protected function amfTestService_faultHandler(event:FaultEvent):void

{

statusLabel.text = "error!";

}

protected function amfTestService_resultHandler(event:ResultEvent):void

{

statusLabel.text = "result!";

}


none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php


On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:
I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.

-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/


Reply | Threaded
Open this post in threaded view
|

RE: RemoteObject

Carlos Cruz

I have a lot of experience with Flex remoting and BlazeDS with Java, but with FlexJS and Royale I have none, but extrapolating from some JS tests I've done with AMF at this line: amfTestService.send("getShippingMethods", []); you have to call a class in gateway.php and a method. Your request needs at least 3 properties. 

 

I'm also assuming your JS file and gateway.php are in the same domain and same port (this gave me problems).

 

Take what I said regarding my experience with FlexJS and Royale into account. 

 

Carlos 

 

 

From: Fréderic Cox [mailto:[hidden email]]
Sent: Sunday, January 14, 2018 4:01 PM
To: [hidden email]
Subject: Re: RemoteObject

 

Script tag was stripped from the post:

 

import org.apache.royale.events.MouseEvent;

                     import org.apache.royale.net.events.FaultEvent;

                     import org.apache.royale.net.events.ResultEvent;

                    

                     protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

                     {

                           statusLabel.text = "calling.......";

                           amfTestService.addEventListener("fault", amfTestService_faultHandler);

                           amfTestService.addEventListener("result", amfTestService_resultHandler);

                           amfTestService.send("getShippingMethods", []);

                     }

                    

                     protected function amfTestService_faultHandler(event:FaultEvent):void

                     {

                           statusLabel.text = "error!";

                     }

                    

                     protected function amfTestService_resultHandler(event:ResultEvent):void

                     {

                           statusLabel.text = "result!";

                     }

 

none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php

 

On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:

I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.


-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

 

Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

Carlos Rovira-2
Hi, 

there's an example that we get it working nicely at:


you can use that as a starting point for your test

As well a java web app that is used along that royale client example is at:


thanks


2018-01-15 3:56 GMT+01:00 Carlos Cruz <[hidden email]>:

I have a lot of experience with Flex remoting and BlazeDS with Java, but with FlexJS and Royale I have none, but extrapolating from some JS tests I've done with AMF at this line: amfTestService.send("getShippingMethods", []); you have to call a class in gateway.php and a method. Your request needs at least 3 properties. 

 

I'm also assuming your JS file and gateway.php are in the same domain and same port (this gave me problems).

 

Take what I said regarding my experience with FlexJS and Royale into account. 

 

Carlos 

 

 

From: Fréderic Cox [mailto:[hidden email]]
Sent: Sunday, January 14, 2018 4:01 PM


To: [hidden email]
Subject: Re: RemoteObject

 

Script tag was stripped from the post:

 

import org.apache.royale.events.MouseEvent;

                     import org.apache.royale.net.events.FaultEvent;

                     import org.apache.royale.net.events.ResultEvent;

                    

                     protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

                     {

                           statusLabel.text = "calling.......";

                           amfTestService.addEventListener("fault", amfTestService_faultHandler);

                           amfTestService.addEventListener("result", amfTestService_resultHandler);

                           amfTestService.send("getShippingMethods", []);

                     }

                    

                     protected function amfTestService_faultHandler(event:FaultEvent):void

                     {

                           statusLabel.text = "error!";

                     }

                    

                     protected function amfTestService_resultHandler(event:ResultEvent):void

                     {

                           statusLabel.text = "result!";

                     }

 

none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php

 

On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:

I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.


-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

 




--
Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

Piotr Zarzycki
Hi Carlos,

Can you describe more how to setup those examples ? Could you add to RemoteObjectAMFTest README.md file where you describe steps. I would like to have AMF on my list for tests and improvements. Whenever I look into that I don't know how to proceed with it.

Thanks, Piotr

2018-01-15 9:21 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi, 

there's an example that we get it working nicely at:


you can use that as a starting point for your test

As well a java web app that is used along that royale client example is at:


thanks


2018-01-15 3:56 GMT+01:00 Carlos Cruz <[hidden email]>:

I have a lot of experience with Flex remoting and BlazeDS with Java, but with FlexJS and Royale I have none, but extrapolating from some JS tests I've done with AMF at this line: amfTestService.send("getShippingMethods", []); you have to call a class in gateway.php and a method. Your request needs at least 3 properties. 

 

I'm also assuming your JS file and gateway.php are in the same domain and same port (this gave me problems).

 

Take what I said regarding my experience with FlexJS and Royale into account. 

 

Carlos 

 

 

From: Fréderic Cox [mailto:[hidden email]]
Sent: Sunday, January 14, 2018 4:01 PM


To: [hidden email]
Subject: Re: RemoteObject

 

Script tag was stripped from the post:

 

import org.apache.royale.events.MouseEvent;

                     import org.apache.royale.net.events.FaultEvent;

                     import org.apache.royale.net.events.ResultEvent;

                    

                     protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

                     {

                           statusLabel.text = "calling.......";

                           amfTestService.addEventListener("fault", amfTestService_faultHandler);

                           amfTestService.addEventListener("result", amfTestService_resultHandler);

                           amfTestService.send("getShippingMethods", []);

                     }

                    

                     protected function amfTestService_faultHandler(event:FaultEvent):void

                     {

                           statusLabel.text = "error!";

                     }

                    

                     protected function amfTestService_resultHandler(event:ResultEvent):void

                     {

                           statusLabel.text = "result!";

                     }

 

none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php

 

On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:

I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.


-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

 




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki

Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

Carlos Rovira-2
Hi Piotr,
I'll put this on my to do list, but have to do some things first.
thanks

2018-01-15 9:26 GMT+01:00 Piotr Zarzycki <[hidden email]>:
Hi Carlos,

Can you describe more how to setup those examples ? Could you add to RemoteObjectAMFTest README.md file where you describe steps. I would like to have AMF on my list for tests and improvements. Whenever I look into that I don't know how to proceed with it.

Thanks, Piotr

2018-01-15 9:21 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi, 

there's an example that we get it working nicely at:


you can use that as a starting point for your test

As well a java web app that is used along that royale client example is at:


thanks


2018-01-15 3:56 GMT+01:00 Carlos Cruz <[hidden email]>:

I have a lot of experience with Flex remoting and BlazeDS with Java, but with FlexJS and Royale I have none, but extrapolating from some JS tests I've done with AMF at this line: amfTestService.send("getShippingMethods", []); you have to call a class in gateway.php and a method. Your request needs at least 3 properties. 

 

I'm also assuming your JS file and gateway.php are in the same domain and same port (this gave me problems).

 

Take what I said regarding my experience with FlexJS and Royale into account. 

 

Carlos 

 

 

From: Fréderic Cox [mailto:[hidden email]]
Sent: Sunday, January 14, 2018 4:01 PM


To: [hidden email]
Subject: Re: RemoteObject

 

Script tag was stripped from the post:

 

import org.apache.royale.events.MouseEvent;

                     import org.apache.royale.net.events.FaultEvent;

                     import org.apache.royale.net.events.ResultEvent;

                    

                     protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

                     {

                           statusLabel.text = "calling.......";

                           amfTestService.addEventListener("fault", amfTestService_faultHandler);

                           amfTestService.addEventListener("result", amfTestService_resultHandler);

                           amfTestService.send("getShippingMethods", []);

                     }

                    

                     protected function amfTestService_faultHandler(event:FaultEvent):void

                     {

                           statusLabel.text = "error!";

                     }

                    

                     protected function amfTestService_resultHandler(event:ResultEvent):void

                     {

                           statusLabel.text = "result!";

                     }

 

none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php

 

On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:

I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.


-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

 




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki




--
Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

Piotr Zarzycki
Carlos,

No problem. I have also couple of huge things related to Royale to do before my hand gets dirty with AMF! :) Unless someone urgently will needed. :)

Thanks, Piotr

2018-01-15 19:27 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi Piotr,
I'll put this on my to do list, but have to do some things first.
thanks

2018-01-15 9:26 GMT+01:00 Piotr Zarzycki <[hidden email]>:
Hi Carlos,

Can you describe more how to setup those examples ? Could you add to RemoteObjectAMFTest README.md file where you describe steps. I would like to have AMF on my list for tests and improvements. Whenever I look into that I don't know how to proceed with it.

Thanks, Piotr

2018-01-15 9:21 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi, 

there's an example that we get it working nicely at:


you can use that as a starting point for your test

As well a java web app that is used along that royale client example is at:


thanks


2018-01-15 3:56 GMT+01:00 Carlos Cruz <[hidden email]>:

I have a lot of experience with Flex remoting and BlazeDS with Java, but with FlexJS and Royale I have none, but extrapolating from some JS tests I've done with AMF at this line: amfTestService.send("getShippingMethods", []); you have to call a class in gateway.php and a method. Your request needs at least 3 properties. 

 

I'm also assuming your JS file and gateway.php are in the same domain and same port (this gave me problems).

 

Take what I said regarding my experience with FlexJS and Royale into account. 

 

Carlos 

 

 

From: Fréderic Cox [mailto:[hidden email]]
Sent: Sunday, January 14, 2018 4:01 PM


To: [hidden email]
Subject: Re: RemoteObject

 

Script tag was stripped from the post:

 

import org.apache.royale.events.MouseEvent;

                     import org.apache.royale.net.events.FaultEvent;

                     import org.apache.royale.net.events.ResultEvent;

                    

                     protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

                     {

                           statusLabel.text = "calling.......";

                           amfTestService.addEventListener("fault", amfTestService_faultHandler);

                           amfTestService.addEventListener("result", amfTestService_resultHandler);

                           amfTestService.send("getShippingMethods", []);

                     }

                    

                     protected function amfTestService_faultHandler(event:FaultEvent):void

                     {

                           statusLabel.text = "error!";

                     }

                    

                     protected function amfTestService_resultHandler(event:ResultEvent):void

                     {

                           statusLabel.text = "result!";

                     }

 

none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php

 

On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:

I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.


-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

 




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki

Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

coxfrederic
For me it is still not working in latest release 0.9.1. I based my example on the example in the SDK.

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/royale/basic" applicationComplete="applicationCompleteHandler(event);">

    <fx:Script>
        <![CDATA[
            import org.apache.royale.net.RemoteObject;
            import org.apache.royale.net.events.FaultEvent;
            import org.apache.royale.net.events.ResultEvent;

            private function applicationCompleteHandler(evt:Event):void{
                testLabel.text = "Requesting from AMF";
                service.send("getPackages", null);
            }

            private function amfFaultHandler(evt:FaultEvent):void{
                testLabel.text = "Fault in calling AMF";
            }

            private function amfResultHandler(evt:ResultEvent):void{
                testLabel.text = "Result received from AMF";
            }
        ]]>
    </fx:Script>

<js:valuesImpl>
<js:SimpleCSSValuesImpl />
</js:valuesImpl>

   <js:beads>
<js:ClassAliasBead />
<js:RemoteObject id="service" result="amfResultHandler(event)" fault="amfFaultHandler(event)"
destination = "Meta"
source = "Meta"/>
</js:beads>

<js:initialView>
<js:View>
<js:Label id="testLabel" />
</js:View>
</js:initialView>
</js:Application>


It is not working and showing the following error in the browser:

Failed to load https://winkelbeheer.cityfashion.be/amfphp/gateway.php: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
Language.js:238 destination fault handler
  1. {code: -1004, message: "Invalid response type.", detail: "Invalid XMLHttpRequest response status or type.", data: null}
    1. code:-1004
    2. data:null
    3. detail:"Invalid XMLHttpRequest response status or type."
    4. message:"Invalid response type."
    5. __proto__:Object



It is able to compile and run regardless of the errors in compile log:

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/AccessorDefinition.js:12: ERROR - required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/AccessorDefinition.js:13: ERROR - required "org.apache.royale.reflection.VariableDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.VariableDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/MethodDefinition.js:14: ERROR - required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/ParameterDefinition.js:13: ERROR- required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/TypeDefinition.js:15: ERROR - required "org.apache.royale.reflection.VariableDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.VariableDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 5 error(s), 0 warning(s)
The project 'HelloRoyale' has been successfully compiled and optimized.
4.566387 seconds


On Mon, Jan 15, 2018 at 7:38 PM, Piotr Zarzycki <[hidden email]> wrote:
Carlos,

No problem. I have also couple of huge things related to Royale to do before my hand gets dirty with AMF! :) Unless someone urgently will needed. :)

Thanks, Piotr

2018-01-15 19:27 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi Piotr,
I'll put this on my to do list, but have to do some things first.
thanks

2018-01-15 9:26 GMT+01:00 Piotr Zarzycki <[hidden email]>:
Hi Carlos,

Can you describe more how to setup those examples ? Could you add to RemoteObjectAMFTest README.md file where you describe steps. I would like to have AMF on my list for tests and improvements. Whenever I look into that I don't know how to proceed with it.

Thanks, Piotr

2018-01-15 9:21 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi, 

there's an example that we get it working nicely at:


you can use that as a starting point for your test

As well a java web app that is used along that royale client example is at:


thanks


2018-01-15 3:56 GMT+01:00 Carlos Cruz <[hidden email]>:

I have a lot of experience with Flex remoting and BlazeDS with Java, but with FlexJS and Royale I have none, but extrapolating from some JS tests I've done with AMF at this line: amfTestService.send("getShippingMethods", []); you have to call a class in gateway.php and a method. Your request needs at least 3 properties. 

 

I'm also assuming your JS file and gateway.php are in the same domain and same port (this gave me problems).

 

Take what I said regarding my experience with FlexJS and Royale into account. 

 

Carlos 

 

 

From: Fréderic Cox [mailto:[hidden email]]
Sent: Sunday, January 14, 2018 4:01 PM


To: [hidden email]
Subject: Re: RemoteObject

 

Script tag was stripped from the post:

 

import org.apache.royale.events.MouseEvent;

                     import org.apache.royale.net.events.FaultEvent;

                     import org.apache.royale.net.events.ResultEvent;

                    

                     protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

                     {

                           statusLabel.text = "calling.......";

                           amfTestService.addEventListener("fault", amfTestService_faultHandler);

                           amfTestService.addEventListener("result", amfTestService_resultHandler);

                           amfTestService.send("getShippingMethods", []);

                     }

                    

                     protected function amfTestService_faultHandler(event:FaultEvent):void

                     {

                           statusLabel.text = "error!";

                     }

                    

                     protected function amfTestService_resultHandler(event:ResultEvent):void

                     {

                           statusLabel.text = "result!";

                     }

 

none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php

 

On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:

I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.


-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

 




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki


Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

Piotr Zarzycki
Frederic,

It looks like it is not problem with framework, but rather CORS issue. Maybe try to install this plugin [1] and add to the list your url.


Piotr

2018-02-15 12:04 GMT+01:00 Fréderic Cox <[hidden email]>:
For me it is still not working in latest release 0.9.1. I based my example on the example in the SDK.

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/royale/basic" applicationComplete="applicationCompleteHandler(event);">

    <fx:Script>
        <![CDATA[
            import org.apache.royale.net.RemoteObject;
            import org.apache.royale.net.events.FaultEvent;
            import org.apache.royale.net.events.ResultEvent;

            private function applicationCompleteHandler(evt:Event):void{
                testLabel.text = "Requesting from AMF";
                service.send("getPackages", null);
            }

            private function amfFaultHandler(evt:FaultEvent):void{
                testLabel.text = "Fault in calling AMF";
            }

            private function amfResultHandler(evt:ResultEvent):void{
                testLabel.text = "Result received from AMF";
            }
        ]]>
    </fx:Script>

<js:valuesImpl>
<js:SimpleCSSValuesImpl />
</js:valuesImpl>

   <js:beads>
<js:ClassAliasBead />
<js:RemoteObject id="service" result="amfResultHandler(event)" fault="amfFaultHandler(event)"
destination = "Meta"
source = "Meta"/>
</js:beads>

<js:initialView>
<js:View>
<js:Label id="testLabel" />
</js:View>
</js:initialView>
</js:Application>


It is not working and showing the following error in the browser:

Failed to load https://winkelbeheer.cityfashion.be/amfphp/gateway.php: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
Language.js:238 destination fault handler
  1. {code: -1004, message: "Invalid response type.", detail: "Invalid XMLHttpRequest response status or type.", data: null}
    1. code:-1004
    2. data:null
    3. detail:"Invalid XMLHttpRequest response status or type."
    4. message:"Invalid response type."
    5. __proto__:Object



It is able to compile and run regardless of the errors in compile log:

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/AccessorDefinition.js:12: ERROR - required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/AccessorDefinition.js:13: ERROR - required "org.apache.royale.reflection.VariableDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.VariableDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/MethodDefinition.js:14: ERROR - required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/ParameterDefinition.js:13: ERROR- required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/TypeDefinition.js:15: ERROR - required "org.apache.royale.reflection.VariableDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.VariableDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 5 error(s), 0 warning(s)
The project 'HelloRoyale' has been successfully compiled and optimized.
4.566387 seconds


On Mon, Jan 15, 2018 at 7:38 PM, Piotr Zarzycki <[hidden email]> wrote:
Carlos,

No problem. I have also couple of huge things related to Royale to do before my hand gets dirty with AMF! :) Unless someone urgently will needed. :)

Thanks, Piotr

2018-01-15 19:27 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi Piotr,
I'll put this on my to do list, but have to do some things first.
thanks

2018-01-15 9:26 GMT+01:00 Piotr Zarzycki <[hidden email]>:
Hi Carlos,

Can you describe more how to setup those examples ? Could you add to RemoteObjectAMFTest README.md file where you describe steps. I would like to have AMF on my list for tests and improvements. Whenever I look into that I don't know how to proceed with it.

Thanks, Piotr

2018-01-15 9:21 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi, 

there's an example that we get it working nicely at:


you can use that as a starting point for your test

As well a java web app that is used along that royale client example is at:


thanks


2018-01-15 3:56 GMT+01:00 Carlos Cruz <[hidden email]>:

I have a lot of experience with Flex remoting and BlazeDS with Java, but with FlexJS and Royale I have none, but extrapolating from some JS tests I've done with AMF at this line: amfTestService.send("getShippingMethods", []); you have to call a class in gateway.php and a method. Your request needs at least 3 properties. 

 

I'm also assuming your JS file and gateway.php are in the same domain and same port (this gave me problems).

 

Take what I said regarding my experience with FlexJS and Royale into account. 

 

Carlos 

 

 

From: Fréderic Cox [mailto:[hidden email]]
Sent: Sunday, January 14, 2018 4:01 PM


To: [hidden email]
Subject: Re: RemoteObject

 

Script tag was stripped from the post:

 

import org.apache.royale.events.MouseEvent;

                     import org.apache.royale.net.events.FaultEvent;

                     import org.apache.royale.net.events.ResultEvent;

                    

                     protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

                     {

                           statusLabel.text = "calling.......";

                           amfTestService.addEventListener("fault", amfTestService_faultHandler);

                           amfTestService.addEventListener("result", amfTestService_resultHandler);

                           amfTestService.send("getShippingMethods", []);

                     }

                    

                     protected function amfTestService_faultHandler(event:FaultEvent):void

                     {

                           statusLabel.text = "error!";

                     }

                    

                     protected function amfTestService_resultHandler(event:ResultEvent):void

                     {

                           statusLabel.text = "result!";

                     }

 

none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php

 

On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:

I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.


-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

 




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki





--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki

Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

coxfrederic
In reply to this post by coxfrederic
Seems CORS was the issue, so I uploaded the script to the same domain then getting the error:

destination fault handler
  1. org.apache.royale.net.remoting.messages.ErrorMessage {_body: {…}, correlationId: "", faultCode: "AMFPHP_FILE_NOT_FOUND", faultDetail: "/var/web/fn0383/enality.clients.v2/amfphp/core/shared/app/BasicActions.php on line 33", faultString: "The class {Amf3Broker} could not be found under th…clients.v2/amfphp/services/amfphp/Amf3Broker.php}"}
    1. correlationId:""
    2. faultCode:"AMFPHP_FILE_NOT_FOUND"
    3. faultDetail:"/var/web/fn0383/enality.clients.v2/amfphp/core/shared/app/BasicActions.php on line 33"
    4. faultString:"The class {Amf3Broker} could not be found under the class path {/var/web/fn0383/enality.clients.v2/amfphp/services/amfphp/Amf3Broker.php}"


Any idea?

On Thu, Feb 15, 2018 at 12:04 PM, Fréderic Cox <[hidden email]> wrote:
For me it is still not working in latest release 0.9.1. I based my example on the example in the SDK.

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/royale/basic" applicationComplete="applicationCompleteHandler(event);">

    <fx:Script>
        <![CDATA[
            import org.apache.royale.net.RemoteObject;
            import org.apache.royale.net.events.FaultEvent;
            import org.apache.royale.net.events.ResultEvent;

            private function applicationCompleteHandler(evt:Event):void{
                testLabel.text = "Requesting from AMF";
                service.send("getPackages", null);
            }

            private function amfFaultHandler(evt:FaultEvent):void{
                testLabel.text = "Fault in calling AMF";
            }

            private function amfResultHandler(evt:ResultEvent):void{
                testLabel.text = "Result received from AMF";
            }
        ]]>
    </fx:Script>

<js:valuesImpl>
<js:SimpleCSSValuesImpl />
</js:valuesImpl>

   <js:beads>
<js:ClassAliasBead />
<js:RemoteObject id="service" result="amfResultHandler(event)" fault="amfFaultHandler(event)"
destination = "Meta"
source = "Meta"/>
</js:beads>

<js:initialView>
<js:View>
<js:Label id="testLabel" />
</js:View>
</js:initialView>
</js:Application>


It is not working and showing the following error in the browser:

Failed to load https://winkelbeheer.cityfashion.be/amfphp/gateway.php: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
Language.js:238 destination fault handler
  1. {code: -1004, message: "Invalid response type.", detail: "Invalid XMLHttpRequest response status or type.", data: null}
    1. code:-1004
    2. data:null
    3. detail:"Invalid XMLHttpRequest response status or type."
    4. message:"Invalid response type."
    5. __proto__:Object



It is able to compile and run regardless of the errors in compile log:

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/AccessorDefinition.js:12: ERROR - required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/AccessorDefinition.js:13: ERROR - required "org.apache.royale.reflection.VariableDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.VariableDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/MethodDefinition.js:14: ERROR - required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/ParameterDefinition.js:13: ERROR- required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/TypeDefinition.js:15: ERROR - required "org.apache.royale.reflection.VariableDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.VariableDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 5 error(s), 0 warning(s)
The project 'HelloRoyale' has been successfully compiled and optimized.
4.566387 seconds


On Mon, Jan 15, 2018 at 7:38 PM, Piotr Zarzycki <[hidden email]> wrote:
Carlos,

No problem. I have also couple of huge things related to Royale to do before my hand gets dirty with AMF! :) Unless someone urgently will needed. :)

Thanks, Piotr

2018-01-15 19:27 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi Piotr,
I'll put this on my to do list, but have to do some things first.
thanks

2018-01-15 9:26 GMT+01:00 Piotr Zarzycki <[hidden email]>:
Hi Carlos,

Can you describe more how to setup those examples ? Could you add to RemoteObjectAMFTest README.md file where you describe steps. I would like to have AMF on my list for tests and improvements. Whenever I look into that I don't know how to proceed with it.

Thanks, Piotr

2018-01-15 9:21 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi, 

there's an example that we get it working nicely at:


you can use that as a starting point for your test

As well a java web app that is used along that royale client example is at:


thanks


2018-01-15 3:56 GMT+01:00 Carlos Cruz <[hidden email]>:

I have a lot of experience with Flex remoting and BlazeDS with Java, but with FlexJS and Royale I have none, but extrapolating from some JS tests I've done with AMF at this line: amfTestService.send("getShippingMethods", []); you have to call a class in gateway.php and a method. Your request needs at least 3 properties. 

 

I'm also assuming your JS file and gateway.php are in the same domain and same port (this gave me problems).

 

Take what I said regarding my experience with FlexJS and Royale into account. 

 

Carlos 

 

 

From: Fréderic Cox [mailto:[hidden email]]
Sent: Sunday, January 14, 2018 4:01 PM


To: [hidden email]
Subject: Re: RemoteObject

 

Script tag was stripped from the post:

 

import org.apache.royale.events.MouseEvent;

                     import org.apache.royale.net.events.FaultEvent;

                     import org.apache.royale.net.events.ResultEvent;

                    

                     protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

                     {

                           statusLabel.text = "calling.......";

                           amfTestService.addEventListener("fault", amfTestService_faultHandler);

                           amfTestService.addEventListener("result", amfTestService_resultHandler);

                           amfTestService.send("getShippingMethods", []);

                     }

                    

                     protected function amfTestService_faultHandler(event:FaultEvent):void

                     {

                           statusLabel.text = "error!";

                     }

                    

                     protected function amfTestService_resultHandler(event:ResultEvent):void

                     {

                           statusLabel.text = "result!";

                     }

 

none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php

 

On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:

I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.


-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

 




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki



Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

Gabe Harbs
In reply to this post by coxfrederic
Make sure you use the -remove-circulars option.

On Feb 15, 2018, at 1:04 PM, Fréderic Cox <[hidden email]> wrote:

It is able to compile and run regardless of the errors in compile log:


Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

coxfrederic
In reply to this post by Piotr Zarzycki
Hi Piotr,

Thanks, I installed the extension and now I'm not getting the CORS error anymore.
I'm not getting any fault or result event triggered either....

The endPoint set is
This is correct, right? (I use this endpoint in Flex and that works fine)

    1. Request URL:
    2. Request Method:
      OPTIONS
    3. Status Code:
      200 OK
    4. Remote Address:
    5. Referrer Policy:
      no-referrer-when-downgrade
  1. Response Headersview source
    1. Connection:
      keep-alive
    2. Content-Encoding:
      gzip
    3. Content-Length:
      286
    4. Content-Type:
      text/html; charset=UTF-8
    5. Date:
      Thu, 15 Feb 2018 13:08:17 GMT
    6. Server:
      nginx
    7. Vary:
      Accept-Encoding
  2. Request Headersview source
    1. Accept:
      */*
    2. Accept-Encoding:
      gzip, deflate, br
    3. Accept-Language:
      en-GB,en-US;q=0.9,en;q=0.8
    4. Access-Control-Request-Headers:
      content-type
    5. Access-Control-Request-Method:
      POST
    6. Connection:
      keep-alive
    7. Host:
    8. Origin:
      null
    9. User-Agent:
      Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
Response is:

<p>amfphp and this gateway are installed correctly. You may now connect to this gateway from Flash.</p><p>Note: If you're reading an old tutorial, it will tell you that you should see a download window instead of this message. This confused people so this is the new behaviour starting from amfphp 1.2.</p><p><a href='http://www.amfphp.org/docs'>View the amfphp documentation</p><p><a href='browser'>Load the service browser</a></p><pre>

Should I target a specific file with the JS version? Should the endPoint be different?

On Thu, Feb 15, 2018 at 12:07 PM, Piotr Zarzycki <[hidden email]> wrote:
Frederic,

It looks like it is not problem with framework, but rather CORS issue. Maybe try to install this plugin [1] and add to the list your url.


Piotr

2018-02-15 12:04 GMT+01:00 Fréderic Cox <[hidden email]>:
For me it is still not working in latest release 0.9.1. I based my example on the example in the SDK.

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/royale/basic" applicationComplete="applicationCompleteHandler(event);">

    <fx:Script>
        <![CDATA[
            import org.apache.royale.net.RemoteObject;
            import org.apache.royale.net.events.FaultEvent;
            import org.apache.royale.net.events.ResultEvent;

            private function applicationCompleteHandler(evt:Event):void{
                testLabel.text = "Requesting from AMF";
                service.send("getPackages", null);
            }

            private function amfFaultHandler(evt:FaultEvent):void{
                testLabel.text = "Fault in calling AMF";
            }

            private function amfResultHandler(evt:ResultEvent):void{
                testLabel.text = "Result received from AMF";
            }
        ]]>
    </fx:Script>

<js:valuesImpl>
<js:SimpleCSSValuesImpl />
</js:valuesImpl>

   <js:beads>
<js:ClassAliasBead />
<js:RemoteObject id="service" result="amfResultHandler(event)" fault="amfFaultHandler(event)"
destination = "Meta"
source = "Meta"/>
</js:beads>

<js:initialView>
<js:View>
<js:Label id="testLabel" />
</js:View>
</js:initialView>
</js:Application>


It is not working and showing the following error in the browser:

Failed to load https://winkelbeheer.cityfashion.be/amfphp/gateway.php: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
Language.js:238 destination fault handler
  1. {code: -1004, message: "Invalid response type.", detail: "Invalid XMLHttpRequest response status or type.", data: null}
    1. code:-1004
    2. data:null
    3. detail:"Invalid XMLHttpRequest response status or type."
    4. message:"Invalid response type."
    5. __proto__:Object



It is able to compile and run regardless of the errors in compile log:

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/AccessorDefinition.js:12: ERROR - required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/AccessorDefinition.js:13: ERROR - required "org.apache.royale.reflection.VariableDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.VariableDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/MethodDefinition.js:14: ERROR - required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/ParameterDefinition.js:13: ERROR- required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/TypeDefinition.js:15: ERROR - required "org.apache.royale.reflection.VariableDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.VariableDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 5 error(s), 0 warning(s)
The project 'HelloRoyale' has been successfully compiled and optimized.
4.566387 seconds


On Mon, Jan 15, 2018 at 7:38 PM, Piotr Zarzycki <[hidden email]> wrote:
Carlos,

No problem. I have also couple of huge things related to Royale to do before my hand gets dirty with AMF! :) Unless someone urgently will needed. :)

Thanks, Piotr

2018-01-15 19:27 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi Piotr,
I'll put this on my to do list, but have to do some things first.
thanks

2018-01-15 9:26 GMT+01:00 Piotr Zarzycki <[hidden email]>:
Hi Carlos,

Can you describe more how to setup those examples ? Could you add to RemoteObjectAMFTest README.md file where you describe steps. I would like to have AMF on my list for tests and improvements. Whenever I look into that I don't know how to proceed with it.

Thanks, Piotr

2018-01-15 9:21 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi, 

there's an example that we get it working nicely at:


you can use that as a starting point for your test

As well a java web app that is used along that royale client example is at:


thanks


2018-01-15 3:56 GMT+01:00 Carlos Cruz <[hidden email]>:

I have a lot of experience with Flex remoting and BlazeDS with Java, but with FlexJS and Royale I have none, but extrapolating from some JS tests I've done with AMF at this line: amfTestService.send("getShippingMethods", []); you have to call a class in gateway.php and a method. Your request needs at least 3 properties. 

 

I'm also assuming your JS file and gateway.php are in the same domain and same port (this gave me problems).

 

Take what I said regarding my experience with FlexJS and Royale into account. 

 

Carlos 

 

 

From: Fréderic Cox [mailto:[hidden email]]
Sent: Sunday, January 14, 2018 4:01 PM


To: [hidden email]
Subject: Re: RemoteObject

 

Script tag was stripped from the post:

 

import org.apache.royale.events.MouseEvent;

                     import org.apache.royale.net.events.FaultEvent;

                     import org.apache.royale.net.events.ResultEvent;

                    

                     protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

                     {

                           statusLabel.text = "calling.......";

                           amfTestService.addEventListener("fault", amfTestService_faultHandler);

                           amfTestService.addEventListener("result", amfTestService_resultHandler);

                           amfTestService.send("getShippingMethods", []);

                     }

                    

                     protected function amfTestService_faultHandler(event:FaultEvent):void

                     {

                           statusLabel.text = "error!";

                     }

                    

                     protected function amfTestService_resultHandler(event:ResultEvent):void

                     {

                           statusLabel.text = "result!";

                     }

 

none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php

 

On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:

I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.


-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

 




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki





--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki


Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject

Piotr Zarzycki
Carlos,

If I remember correctly there wasn't any test with AMFPHP, but rather with some JAVA sources yes ?

Thanks,
Piotr


2018-02-15 14:09 GMT+01:00 Fréderic Cox <[hidden email]>:
Hi Piotr,

Thanks, I installed the extension and now I'm not getting the CORS error anymore.
I'm not getting any fault or result event triggered either....

The endPoint set is
This is correct, right? (I use this endpoint in Flex and that works fine)

    1. Request URL:
    2. Request Method:
      OPTIONS
    3. Status Code:
      200 OK
    4. Remote Address:
    5. Referrer Policy:
      no-referrer-when-downgrade
  1. Response Headersview source
    1. Connection:
      keep-alive
    2. Content-Encoding:
      gzip
    3. Content-Length:
      286
    4. Content-Type:
      text/html; charset=UTF-8
    5. Date:
      Thu, 15 Feb 2018 13:08:17 GMT
    6. Server:
      nginx
    7. Vary:
      Accept-Encoding
  2. Request Headersview source
    1. Accept:
      */*
    2. Accept-Encoding:
      gzip, deflate, br
    3. Accept-Language:
      en-GB,en-US;q=0.9,en;q=0.8
    4. Access-Control-Request-Headers:
      content-type
    5. Access-Control-Request-Method:
      POST
    6. Connection:
      keep-alive
    7. Host:
    8. Origin:
      null
    9. User-Agent:
      Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
Response is:

<p>amfphp and this gateway are installed correctly. You may now connect to this gateway from Flash.</p><p>Note: If you're reading an old tutorial, it will tell you that you should see a download window instead of this message. This confused people so this is the new behaviour starting from amfphp 1.2.</p><p><a href='http://www.amfphp.org/docs'>View the amfphp documentation</p><p><a href='browser'>Load the service browser</a></p><pre>

Should I target a specific file with the JS version? Should the endPoint be different?

On Thu, Feb 15, 2018 at 12:07 PM, Piotr Zarzycki <[hidden email]> wrote:
Frederic,

It looks like it is not problem with framework, but rather CORS issue. Maybe try to install this plugin [1] and add to the list your url.


Piotr

2018-02-15 12:04 GMT+01:00 Fréderic Cox <[hidden email]>:
For me it is still not working in latest release 0.9.1. I based my example on the example in the SDK.

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/royale/basic" applicationComplete="applicationCompleteHandler(event);">

    <fx:Script>
        <![CDATA[
            import org.apache.royale.net.RemoteObject;
            import org.apache.royale.net.events.FaultEvent;
            import org.apache.royale.net.events.ResultEvent;

            private function applicationCompleteHandler(evt:Event):void{
                testLabel.text = "Requesting from AMF";
                service.send("getPackages", null);
            }

            private function amfFaultHandler(evt:FaultEvent):void{
                testLabel.text = "Fault in calling AMF";
            }

            private function amfResultHandler(evt:ResultEvent):void{
                testLabel.text = "Result received from AMF";
            }
        ]]>
    </fx:Script>

<js:valuesImpl>
<js:SimpleCSSValuesImpl />
</js:valuesImpl>

   <js:beads>
<js:ClassAliasBead />
<js:RemoteObject id="service" result="amfResultHandler(event)" fault="amfFaultHandler(event)"
destination = "Meta"
source = "Meta"/>
</js:beads>

<js:initialView>
<js:View>
<js:Label id="testLabel" />
</js:View>
</js:initialView>
</js:Application>


It is not working and showing the following error in the browser:

Failed to load https://winkelbeheer.cityfashion.be/amfphp/gateway.php: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
Language.js:238 destination fault handler
  1. {code: -1004, message: "Invalid response type.", detail: "Invalid XMLHttpRequest response status or type.", data: null}
    1. code:-1004
    2. data:null
    3. detail:"Invalid XMLHttpRequest response status or type."
    4. message:"Invalid response type."
    5. __proto__:Object



It is able to compile and run regardless of the errors in compile log:

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/AccessorDefinition.js:12: ERROR - required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/AccessorDefinition.js:13: ERROR - required "org.apache.royale.reflection.VariableDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.VariableDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/MethodDefinition.js:14: ERROR - required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/ParameterDefinition.js:13: ERROR- required "org.apache.royale.reflection.TypeDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.TypeDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/frederic/Desktop/Personal/Web Projects/Workspaces/Royale/HelloRoyale/bin/js-debug/org/apache/royale/reflection/TypeDefinition.js:15: ERROR - required "org.apache.royale.reflection.VariableDefinition" namespace not provided yet
goog.require('org.apache.royale.reflection.VariableDefinition');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Feb 15, 2018 11:51:04 AM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 5 error(s), 0 warning(s)
The project 'HelloRoyale' has been successfully compiled and optimized.
4.566387 seconds


On Mon, Jan 15, 2018 at 7:38 PM, Piotr Zarzycki <[hidden email]> wrote:
Carlos,

No problem. I have also couple of huge things related to Royale to do before my hand gets dirty with AMF! :) Unless someone urgently will needed. :)

Thanks, Piotr

2018-01-15 19:27 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi Piotr,
I'll put this on my to do list, but have to do some things first.
thanks

2018-01-15 9:26 GMT+01:00 Piotr Zarzycki <[hidden email]>:
Hi Carlos,

Can you describe more how to setup those examples ? Could you add to RemoteObjectAMFTest README.md file where you describe steps. I would like to have AMF on my list for tests and improvements. Whenever I look into that I don't know how to proceed with it.

Thanks, Piotr

2018-01-15 9:21 GMT+01:00 Carlos Rovira <[hidden email]>:
Hi, 

there's an example that we get it working nicely at:


you can use that as a starting point for your test

As well a java web app that is used along that royale client example is at:


thanks


2018-01-15 3:56 GMT+01:00 Carlos Cruz <[hidden email]>:

I have a lot of experience with Flex remoting and BlazeDS with Java, but with FlexJS and Royale I have none, but extrapolating from some JS tests I've done with AMF at this line: amfTestService.send("getShippingMethods", []); you have to call a class in gateway.php and a method. Your request needs at least 3 properties. 

 

I'm also assuming your JS file and gateway.php are in the same domain and same port (this gave me problems).

 

Take what I said regarding my experience with FlexJS and Royale into account. 

 

Carlos 

 

 

From: Fréderic Cox [mailto:[hidden email]]
Sent: Sunday, January 14, 2018 4:01 PM


To: [hidden email]
Subject: Re: RemoteObject

 

Script tag was stripped from the post:

 

import org.apache.royale.events.MouseEvent;

                     import org.apache.royale.net.events.FaultEvent;

                     import org.apache.royale.net.events.ResultEvent;

                    

                     protected function textbutton_clickHandler(event:org.apache.royale.events.MouseEvent):void

                     {

                           statusLabel.text = "calling.......";

                           amfTestService.addEventListener("fault", amfTestService_faultHandler);

                           amfTestService.addEventListener("result", amfTestService_resultHandler);

                           amfTestService.send("getShippingMethods", []);

                     }

                    

                     protected function amfTestService_faultHandler(event:FaultEvent):void

                     {

                           statusLabel.text = "error!";

                     }

                    

                     protected function amfTestService_resultHandler(event:ResultEvent):void

                     {

                           statusLabel.text = "result!";

                     }

 

none of the events are triggered ..URL is http://winkelbeheer.cityfashion.be/amfphp/gateway.php

 

On Fri, Jan 12, 2018 at 4:55 AM, Carlos Cruz <[hidden email]> wrote:

I may be blind (and or ignorant as I'm more familiar with Flex) but where
are you sending an AMF request? I don't see any code that sends a request to
a service and invokes method.


-----Original Message-----
From: coxfrederic [mailto:[hidden email]]
Sent: Thursday, January 11, 2018 9:09 PM
To: [hidden email]
Subject: Re: RemoteObject

<?xml version="1.0" encoding="utf-8"?>

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
        <fx:Script>

        </fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>

        <js:beads>
                <js:ClassAliasBead />
                <js:RemoteObject id="amfTestService"

endPoint="http://winkelbeheer.cityfashion.be/amfphp/gateway.php"
                                                 destination="Meta"
source="Meta" />
        </js:beads>

    <js:initialView>
        <js:View>
                        <js:VGroup>
                                <js:Label id="statusLabel" text="Hello
World!" />
                                <js:TextButton text="Get AMF data"
click="textbutton_clickHandler(event)" />
                        </js:VGroup>
        </js:View>
    </js:initialView>
</js:Application>


Any idea why I'm not getting a fault nor success event on this?



--
Sent from: http://apache-royale-users.20374.n8.nabble.com/

 




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki




--



--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki





--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki





--

Piotr Zarzycki 

Patreon: https://www.patreon.com/piotrzarzycki

123