This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 8df32a2  Fix 2 AMF issues in JS build: 1) pass in the AMF URI, as 
currently it's always NULL, and set it in the messageBody 2) fix the 'params' 
parameter in AMFNetConnection.call, as otherwise it's not possible to send in 
an array of optional parameters
     new 2f45293  Merge pull request #1023 from 
SemiConscious/feature/AMF-fixes-for-target-URI-and-params
8df32a2 is described below

commit 8df32a2c3359eebb661c0329557c6d59d0bdfe0e
Author: Jim Page <[email protected]>
AuthorDate: Wed Dec 30 17:54:47 2020 +0000

    Fix 2 AMF issues in JS build:
    1) pass in the AMF URI, as currently it's always NULL, and set it in the 
messageBody
    2) fix the 'params' parameter in AMFNetConnection.call, as otherwise it's 
not possible to send in an array of optional parameters
---
 .../projects/MXRoyale/src/main/royale/mx/net/NetConnection.as  |  3 ++-
 .../org/apache/royale/net/remoting/amf/AMFNetConnection.as     | 10 +++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/net/NetConnection.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/net/NetConnection.as
index fca0bdc..d0e84ac 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/net/NetConnection.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/net/NetConnection.as
@@ -150,7 +150,8 @@ public class NetConnection extends EventDispatcher
         var ncResponder:org.apache.royale.net.Responder = 
                         new 
org.apache.royale.net.Responder(responder.resultFunction,
                                                               
responder.faultFunction);
-        nc.call(null, ncResponder, message);
+        // Jim P: pass the AMF target URI in here 
+        nc.call(thisObject as String, ncResponder, message);
     }
 }
 
diff --git 
a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFNetConnection.as
 
b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFNetConnection.as
index d176fcc..a28538b 100644
--- 
a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFNetConnection.as
+++ 
b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFNetConnection.as
@@ -287,7 +287,11 @@ public class AMFNetConnection
      *  @productversion BlazeDS 4
      *  @productversion LCDS 3
      */
-    public function call(command:String, responder:Responder, ... params):void
+    /* JimP: params should match what is sent into NetConnection.call, which 
is currently an IMessage.
+       If a 'rest' variable is used then only the first member of a passed 
array arrives. Fixed by
+       changing to an Object.
+    */
+    public function call(command:String, responder:Responder, 
params:Object):void
     {
         COMPILE::SWF
         {
@@ -301,6 +305,8 @@ public class AMFNetConnection
             requestQueue.push(
                     {
                         url: url,
+                        /* JimP: this is the AMF URI */
+                        target: command,
                         responder: responder,
                         args: params
                     }
@@ -328,6 +334,8 @@ public class AMFNetConnection
             var actionMessage:ActionMessage = new ActionMessage();
             var messageBody:MessageBody = new MessageBody();
             sequence++;
+            /* insert the AMF URI into the body, otherwise it's always 'null' 
*/
+            messageBody.targetURI = call.item.target;
             messageBody.responseURI = "/" + sequence.toString();
             messageBody.data = args;
             actionMessage.bodies = [ messageBody ];

Reply via email to