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

Re: Longer Character Parameter




Scott,

In V6R1, IBM added %ADDR(myvar:*DATA) so it's no longer needed to add 2 or 4. And since V6R1 is required for variables larger than 65535, there's really no need to still use this old VARPREF method. (Unless you still want to support V5R4, which, granted -- I do at this point.)

As I said to Arturo, it'd be better to NOT modify HTTPAPI, since that'll make upgrades more difficult. Since this is just a one-liner subprocedure, I would suggest he create his own wrapper for http_url_encoder_addvar() if he needs to do this frequently. That way, his copy of HTTPAPI will remain compatible with everyone else's, and won't break when he upgrades (or require changes with each upgrade), etc.

At least in this case, it's pretty easy to do.

-SK

On 11/5/2014 3:36 PM, Scott Mildenberger wrote:
You need to also change the value of the constant:

      D VARPREF         C                   4   <------Change to 4 from 2

This is because the definition below defines the length prefix to be 4 when it was 2 previously

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

Or if you are on a recent enough version of the system you can change the line

                                       :%addr(peValue)+VARPREF
To
                                       :%addr(peValue : *data)

And avoid the use of the constant at all.

Scott


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Arturo
Sent: Wednesday, November 05, 2014 9:34 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Longer Character Parameter


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 the 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:
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
-----------------------------------------------------------------------