You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by "radu.flash@gmail.com" <ra...@gmail.com> on 2018/07/27 14:59:57 UTC

Re: [AMF] How to setup RemoteObjectAMFTest

Hello people,

   I have a client a flash player swf that connects to Blaze DS like this:

public var serverSTUB:String = "https://voip-manager.spherecom.com:9443"
public static var cs:ChannelSet=null;

public function main():void
			{
				cs = new ChannelSet();
					streaminAMFChannel = new
SecureStreamingAMFChannel("my-secure-amf-stream", serverSTUB + "/RiaService"
+ "/messagebroker/securestreamingamf");
					amfChannel = new SecureAMFChannel("my-secure-amf",serverSTUB +
"/RiaService" + "/messagebroker/amflongpolling");
				
				amfChannel.requestTimeout = 45;
				//amfChannel.addEventListener(MessageEvent.MESSAGE, handleMessageTest);
				cs.heartbeatInterval = 30000;
				cs.addChannel(streaminAMFChannel);
				cs.addChannel(amfChannel);
				
			}

protected function onClick(event:MouseEvent=null):void
			{
				var user:String = "rbirsan"
				var token:AsyncToken = cs.login(user.toUpperCase(), "ThisISWork!");
				token.addResponder(	new AsyncResponder(checkAPIVersion,
handleReauthenticateFault));
			}



Can I make the login process work with Apache Royale JS?
I have no experience working with it and would appreciate any help.
Willing to pay,
Thank you in advance 

P.S: 
Service config XML:
<?xml version="1.0" encoding="UTF-8"?>
<services-config>

    <services>
        <default-channels>
		   <channel ref="my-streaming-amf"/>
		   <channel ref="my-longpolling-amf"/>
		   <channel ref="my-amf"/>
        </default-channels>
    </services>

    <channels>
		
        <channel-definition id="my-amf"
class="mx.messaging.channels.AMFChannel">
            <endpoint
url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
		
		
        <channel-definition id="my-secure-amf"
class="mx.messaging.channels.SecureAMFChannel">
            <endpoint
url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure"
class="flex.messaging.endpoints.SecureAMFEndpoint"/>
            <properties>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>
		
		
        <channel-definition id="my-polling-amf"
class="mx.messaging.channels.AMFChannel">
            <endpoint
url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling"
class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-seconds>4</polling-interval-seconds>
            </properties>
        </channel-definition>
        
		
		<channel-definition id="my-longpolling-amf"
class="mx.messaging.channels.AMFChannel">
			<endpoint
url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling"
class="flex.messaging.endpoints.AMFEndpoint"/>
			<properties>
				<polling-enabled>true</polling-enabled>
				<polling-interval-millis>1</polling-interval-millis>
				<wait-interval-millis>30000</wait-interval-millis>
				<client-wait-interval-millis>1</client-wait-interval-millis>
				<max-waiting-poll-requests>3000</max-waiting-poll-requests>
			</properties>
		</channel-definition>        
		
		
		 <channel-definition id="my-secure-amf-stream"
			class="mx.messaging.channels.SecureStreamingAMFChannel">
			<endpoint
url="https://{server.name}:{server.port}/{context.root}/messagebroker/securestreamingamf" 
				class="flex.messaging.endpoints.SecureStreamingAMFEndpoint"/>
				<properties>
					<add-no-cache-headers>false</add-no-cache-headers>
					<max-streaming-clients>10000</max-streaming-clients>
				
<server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis>
					<connect-timeout-seconds>50</connect-timeout-seconds>
				</properties>
		</channel-definition> 
		
		
        <channel-definition id="my-streaming-amf"
class="mx.messaging.channels.StreamingAMFChannel">
            <endpoint
url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf"
class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
            <properties>
				<max-streaming-clients>10000</max-streaming-clients>
			
<server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis>
				<connect-timeout-seconds>50</connect-timeout-seconds>
			</properties>
        </channel-definition>

    </channels>
    
    <security>
    	<security-constraint id="trusted">
            <roles>
                <role>ROLE_USER</role>
                <role>ROLE_ADMIN</role>
            </roles>
        </security-constraint>
    </security>

    <logging>
        <target class="flex.messaging.log.ConsoleTarget" level="Warn">
            <properties>
                <prefix>[BlazeDS] </prefix>
                <includeDate>false</includeDate>
                <includeTime>false</includeTime>
                <includeLevel>false</includeLevel>
                <includeCategory>false</includeCategory>
            </properties>
            <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
            </filters>
        </target>
    </logging>

    <system>
        <redeploy>
            <enabled>false</enabled>
        </redeploy>
    </system>

</services-config>





    



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: [AMF] How to setup RemoteObjectAMFTest

Posted by Carlos Rovira <ca...@apache.org>.
Hi Radu,

yes, AMF / RemoteObject is ready in Apache Royale.

please check this [1]

and check the two example projects in our repo for client [2] and [3]
server:

Just let you know that ChannelSet does not exists in Apache Royale, but you
don't needed. For example something like this

<js:RemoteObject id="loginService"
                         result="onLoginResult(event)" fault=
"onFault(event)"
                         endPoint = "
http://localhost:8080/mycontext/messagebroker/login"
                         destination = "loginService"/>


is what you will use in Apache Royale.

As well as is stated in [1] remember to turn off small message

[1]
https://github.com/apache/royale-asjs/wiki/Apache-Royale-communication-with-AMF-and-RemoteObject
[2] RemoteObjectAMFTest
<https://github.com/apache/royale-asjs/tree/develop/examples/royale/RemoteObjectAMFTest>
[3] SampleAmfWebApp
<https://github.com/apache/royale-asjs/tree/develop/examples/amf/SampleAmfWebApp>



2018-07-27 16:59 GMT+02:00 radu.flash@gmail.com <ra...@gmail.com>:

> Hello people,
>
>    I have a client a flash player swf that connects to Blaze DS like this:
>
> public var serverSTUB:String = "https://voip-manager.spherecom.com:9443"
> public static var cs:ChannelSet=null;
>
> public function main():void
>                         {
>                                 cs = new ChannelSet();
>                                         streaminAMFChannel = new
> SecureStreamingAMFChannel("my-secure-amf-stream", serverSTUB +
> "/RiaService"
> + "/messagebroker/securestreamingamf");
>                                         amfChannel = new
> SecureAMFChannel("my-secure-amf",serverSTUB +
> "/RiaService" + "/messagebroker/amflongpolling");
>
>                                 amfChannel.requestTimeout = 45;
>                                 //amfChannel.addEventListener(MessageEvent.MESSAGE,
> handleMessageTest);
>                                 cs.heartbeatInterval = 30000;
>                                 cs.addChannel(streaminAMFChannel);
>                                 cs.addChannel(amfChannel);
>
>                         }
>
> protected function onClick(event:MouseEvent=null):void
>                         {
>                                 var user:String = "rbirsan"
>                                 var token:AsyncToken =
> cs.login(user.toUpperCase(), "ThisISWork!");
>                                 token.addResponder(     new AsyncResponder(
> checkAPIVersion,
> handleReauthenticateFault));
>                         }
>
>
>
> Can I make the login process work with Apache Royale JS?
> I have no experience working with it and would appreciate any help.
> Willing to pay,
> Thank you in advance
>
> P.S:
> Service config XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <services-config>
>
>     <services>
>         <default-channels>
>                    <channel ref="my-streaming-amf"/>
>                    <channel ref="my-longpolling-amf"/>
>                    <channel ref="my-amf"/>
>         </default-channels>
>     </services>
>
>     <channels>
>
>         <channel-definition id="my-amf"
> class="mx.messaging.channels.AMFChannel">
>             <endpoint
> url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
> class="flex.messaging.endpoints.AMFEndpoint"/>
>         </channel-definition>
>
>
>         <channel-definition id="my-secure-amf"
> class="mx.messaging.channels.SecureAMFChannel">
>             <endpoint
> url="https://{server.name}:{server.port}/{context.root}/
> messagebroker/amfsecure"
> class="flex.messaging.endpoints.SecureAMFEndpoint"/>
>             <properties>
>                 <add-no-cache-headers>false</add-no-cache-headers>
>             </properties>
>         </channel-definition>
>
>
>         <channel-definition id="my-polling-amf"
> class="mx.messaging.channels.AMFChannel">
>             <endpoint
> url="http://{server.name}:{server.port}/{context.root}/
> messagebroker/amfpolling"
> class="flex.messaging.endpoints.AMFEndpoint"/>
>             <properties>
>                 <polling-enabled>true</polling-enabled>
>                 <polling-interval-seconds>4</polling-interval-seconds>
>             </properties>
>         </channel-definition>
>
>
>                 <channel-definition id="my-longpolling-amf"
> class="mx.messaging.channels.AMFChannel">
>                         <endpoint
> url="http://{server.name}:{server.port}/{context.root}/
> messagebroker/amflongpolling"
> class="flex.messaging.endpoints.AMFEndpoint"/>
>                         <properties>
>                                 <polling-enabled>true</polling-enabled>
>                                 <polling-interval-millis>1</
> polling-interval-millis>
>                                 <wait-interval-millis>30000</
> wait-interval-millis>
>                                 <client-wait-interval-millis>
> 1</client-wait-interval-millis>
>                                 <max-waiting-poll-requests>
> 3000</max-waiting-poll-requests>
>                         </properties>
>                 </channel-definition>
>
>
>                  <channel-definition id="my-secure-amf-stream"
>                         class="mx.messaging.channels.
> SecureStreamingAMFChannel">
>                         <endpoint
> url="https://{server.name}:{server.port}/{context.root}/messagebroker/securestreamingamf"
>
>                                 class="flex.messaging.endpoints.
> SecureStreamingAMFEndpoint"/>
>                                 <properties>
>                                         <add-no-cache-headers>false</
> add-no-cache-headers>
>                                         <max-streaming-clients>10000</
> max-streaming-clients>
>
> <server-to-client-heartbeat-millis>5000</server-to-client-
> heartbeat-millis>
>                                         <connect-timeout-seconds>50</
> connect-timeout-seconds>
>                                 </properties>
>                 </channel-definition>
>
>
>         <channel-definition id="my-streaming-amf"
> class="mx.messaging.channels.StreamingAMFChannel">
>             <endpoint
> url="http://{server.name}:{server.port}/{context.root}/
> messagebroker/streamingamf"
> class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
>             <properties>
>                                 <max-streaming-clients>10000</
> max-streaming-clients>
>
> <server-to-client-heartbeat-millis>5000</server-to-client-
> heartbeat-millis>
>                                 <connect-timeout-seconds>50</
> connect-timeout-seconds>
>                         </properties>
>         </channel-definition>
>
>     </channels>
>
>     <security>
>         <security-constraint id="trusted">
>             <roles>
>                 <role>ROLE_USER</role>
>                 <role>ROLE_ADMIN</role>
>             </roles>
>         </security-constraint>
>     </security>
>
>     <logging>
>         <target class="flex.messaging.log.ConsoleTarget" level="Warn">
>             <properties>
>                 <prefix>[BlazeDS] </prefix>
>                 <includeDate>false</includeDate>
>                 <includeTime>false</includeTime>
>                 <includeLevel>false</includeLevel>
>                 <includeCategory>false</includeCategory>
>             </properties>
>             <filters>
>                 <pattern>Endpoint.*</pattern>
>                 <pattern>Service.*</pattern>
>                 <pattern>Configuration</pattern>
>             </filters>
>         </target>
>     </logging>
>
>     <system>
>         <redeploy>
>             <enabled>false</enabled>
>         </redeploy>
>     </system>
>
> </services-config>
>
>
>
>
>
>
>
>
>
> --
> Sent from: http://apache-royale-development.20373.n8.nabble.com/
>



-- 
Carlos Rovira
http://about.me/carlosrovira