1 Reply Latest reply on May 18, 2007 8:44 AM by jlm23

    AMF inserting extra null parameter

    jlm23 Level 1
      I have a flex 2.0.1 application talking to CF 7,0,2,142559 via AMF remoteObject.

      One of my calls has 26 arguments. When CF receives them the value of the 25th gets shoved to the 26th. The 25th is then null. The value of the 26th is gone.

      THE Flex AS3 code:

      sendRO.destination = "ColdFusion";
      sendRO.source = "remoting.clientCUD"
      sendRO.updateClient.addEventListener(mx.rpc.events.ResultEvent.RESULT, handleResult);
      sendRO.updateClient.addEventListener(mx.rpc.events.FaultEvent.FAULT, handleFault);

      sendRO.updateClient(
      myKey,
      client_key,
      contact_key,
      website_user_key,

      honorific_key,
      contact_first,
      contact_last,
      contact_middle,
      contact_suffix_key,
      date_of_birth,
      gender,
      genderIndex,
      smoker,

      billing_id,
      status,
      start_date,
      status_date,
      training_coordinator_key,
      company_location_key,

      E_med_ortho,
      E_nutrition,
      E_medication,
      goals,
      activity_plan,
      5,
      345
      );
      The ouput from trace on the Flex builder console:

      (mx.messaging.messages::RemotingMessage)#0
      body = (Array)#1
      [0] "=EÜgPä¶??ïÛûÔNÝ" YES THIS IS SUPPOSED TO BE THIS WAY
      [1] 845
      [2] 943
      [3] 956
      [4] 2
      [5] "ss"
      [6] "mills"
      [7] "mmm"
      [8] 1
      [9] "05/12/1958"
      [10] ""
      [11] 0
      [12] "0"
      [13] (null)
      [14] ""
      [15] "05/17/2007"
      [16] "12/12/2002"
      [17] 52
      [18] 13
      [19] ""
      [20] ""
      [21] ""
      [22] ""
      [23] ""
      [24] 5
      [25] 345

      The CF code:

      <cfcomponent>
      <cffunction name="updateClient" access="remote" returntype="boolean">
      <cfargument name="maybeTkey" type="string" required="yes">
      <cfargument name="client_key" required="yes" type="numeric">
      <cfargument name="contact_key" required="yes" type="numeric">
      <cfargument name="website_user_key" required="yes" type="numeric">

      <cfargument name="honorific_key" required="yes" type="numeric">
      <cfargument name="contact_first" required="yes" type="string">
      <cfargument name="contact_last" required="yes" type="string">
      <cfargument name="contact_middle" required="yes" type="string">
      <cfargument name="contact_suffix_key" required="yes" type="numeric">
      <cfargument name="date_of_birth" required="yes" type="string">
      <cfargument name="gender" required="yes" type="string">
      <cfargument name="smoker" required="yes" type="string">

      <cfargument name="billing_id" required="yes" type="string">
      <cfargument name="status" required="yes" type="string">
      <cfargument name="start_date" required="yes" type="string">
      <cfargument name="status_date" required="yes" type="string">
      <cfargument name="training_coordinator_key" required="yes" type="numeric">
      <cfargument name="company_location_key" required="yes" type="numeric">

      <cfargument name="med_ortho" required="yes" type="string">
      <cfargument name="nutrition" required="yes" type="string">
      <cfargument name="medication" required="yes" type="string">
      <cfargument name="goals" required="yes" type="string">
      <cfargument name="activity_plan" required="yes" type="string">
      <cfargument name="intensity" required="no">
      <cfargument name="garbage" required="no">

      <cftrace text="in there8">
      <cftrace var="ARGUMENTS">
      <cftrace var="ARGUMENTS.intensity">
      <cftrace var="ARGUMENTS.garbage">

      The cftrace log:


      [31 ms (1st trace)] [C:\Inetpub\121local\remoting\clientCUD.cfc @ line: 34] - in there8

      [47 ms (16)] [C:\Inetpub\121local\remoting\clientCUD.cfc @ line: 35] - [ARGUMENTS = Struct (26)]

      [47 ms (0)] [C:\Inetpub\121local\remoting\clientCUD.cfc @ line: 36] - [ARGUMENTS.intensity = ]

      [47 ms (0)] [C:\Inetpub\121local\remoting\clientCUD.cfc @ line: 37] - [ARGUMENTS.garbage = 5]

      console snippet:

      [20] ""
      [21] ""
      [22] ""
      [23] ""
      [24] 5
      [25] 345

      What should I do?