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

Re: Value String larger than 65535



Note to self:  Definitely need an example of HTTP_xmlReturnPtr() in the 
EXAMPLE programs.

Hi Johan,

On 8/23/2010 8:50 AM, Johan Wigh wrote:
>  Hi!
>  is it possible to receive a string in single element larger then 65535
>  bytes.

Yes.  HTTPAPI returns 65535A because it's easy to work with, but it's 
also capable of returning a pointer and a length.  When this is done, 
the length can be as large as 16mb per element.

To use this feature, you must do the following BEFORE calling any 
routines that work with XML:

     http_XmlReturnPtr(*ON);

This tells HTTPAPI to return a pointer instead of a string, making it 
possible to handle longer elements.

Then you'll want to update your End Element Handler (it looks like 
you've named yours "Incoming") to receive a DS containing a pointer and 
a length, like this:

  D value_t         ds                  qualified
  D   valptr                        *
  D   len                         10i 0

  D Incoming        PR
  D   userdata                      *   value
  D   depth                       10I 0 value
  D   name                      1024A   varying const
  D   path                     24576A   varying const
  D   retval                            likeds(value_t)
  D   Attrs                         *   dim(32767)

Now you can handle up to 16mb for the element's value, but of course, 
you have to use pointer logic to access the data.  (That's the best I 
can do without requiring v6r1 or higher to use HTTPAPI!)
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------