[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Longer Character Parameter



   Arturo,
   HTTPAPI supports releases older than V6R1.   Those releases do not
   allow RPG variables longer than 65535 -- and that's why
   WEBFORM_addVar() is limited to 65535,
   Please do not modify WEBFORM_addVar.
   Instead, call http_url_encoder_addvar() directly for your 500000
   variable, like this:
      http_url_encoder_addvar( form
                             : 'clientName'
                             : %addr(siteName:*DATA)
                             : %len(siteName));

   Or, if you need to do this very frequently and therefore want something
   equivalent to WEBFORM_addVar, may I suggest that you create your own
   routine instead of modifying mine?    That way, you won't have to re-do
   your changes each time you update HTTPAPI
           P ARTURO_addVar...
           P                 B                   Export
           D                 PI             1N
           D  peEncoder                      *   value
           D  peVariable                   50A   varying value
           D  peValue                  500000A   Varying Value
            /free
             return http_url_encoder_addvar( peEncoder
                                           : peVariable
                                           : %addr(peValue:*DATA)
                                           : %len(peValue) );
            /end-free
           P                 E
   But, beware, as your strings get larger & larger, it'll be increasingly
   more efficient to call http_url_encoder_addvar() vs. using a procedure
   that accepts a string by value.   The WEBFORM_addVar() was intended as
   a "simplifier" to make things easy...   and making a copy of a 64k
   string isn't a big deal.  But, now you're asking it to make a copy of a
   500k string...  the longer it'll take to copy it.

   On 11/5/2014 10:33 AM, Arturo wrote:

   Email Server keeps bouncing this back. Hopefully you have received.

   Hello,


   I need your help. I am calling the following procedure, which is
   defined as:

        P WEBFORM_addVar...

        P                 B                   Export

        D                 PI             1N

        D  peEncoder                      *   value

        D  peVariable                   50A   varying value

        D  peValue                   65535A   Varying Value


         * Local Defined Variables

        D VARPREF         C                   2


         /free

          return http_url_encoder_addvar( peEncoder

                                         :peVariable

                                         :%addr(peValue)+VARPREF

                                         :%len(peValue));

         /end-free

        P                 E


   I want to change peValue to a longer character variable, such as:

        D   peValue                       A   Len(500000) Varying(4) Value


   Problem I am facing is that the call to WEBFORM_addVar, to create my
   post http call, is not working.

   I get the following http error back:

   �Invalid ClientName / GUID�. Client Name and GUID are part of t
he URI.


   Here is how I am calling WEBFORM_addVar:

          siteName = wSiteName;

          GUID = wGUID;

          form = webForm_open();

          WEBFORM_addVar(form :'ClientName' :siteName );

          WEBFORM_addVar(form :'guid' : GUID );

   Looking at the URI, after ClientName=, it is adding %00%9D, and after
   GUID=, it is adding %00%88.


   Any ideas why this is happening? I hope I provided enough info, if not,
   let me know and I�ll send more details.


   Thank you


   Art Duarte


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
[1]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

References

   1. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------