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

RE: recvchunk: saveproc: Not all data was written



Scott

Doh!   Of course I have the RcvRawDta program in my code, unaltered from the
example.

And I figured out what the problem is; the returned string is way longer
than 64k -- Looks like I'll be checking out your Expat solution.


Thanks much for being so very helpful to the iSeries community.


Regards,
Hawk


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Wednesday, April 18, 2007 1:19 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: recvchunk: saveproc: Not all data was written

Hi Tim,

The "raw" routines in HTTPAPI let you supply your own "saveproc" 
routine.  The idea is that each time data is received, it calls your 
custom-written subprocedure, and lets that subprocedure do the work.

If you look closely at the prototype for saveproc, you'll see that the 
code looks something like this:

       D saveproc        PR            10I 0 ExtProc(peProcedure)
       D  fd                           10I 0 value
       D  data                           *   value
       D  length                       10I 0 value

Notice the ExtProc() keyword. This tells RPG to call a procedure based 
on a procedure pointer.  In this case, the pointer is called peProcedure.

If you trace it back, you'll see that peProcedure is a parameter that 
ultimately comes from your call to http_url_post_raw().  Specifically, 
you coded %paddr(RcvRawDta) for that parameter.

So each time "saveproc" is called in HTTPAPI, it'll actually call your 
subprocedure named RcvRawDta().

If you want to find out why saveproc is returning 8191 instead of the 
correct value of 8192, you need to look at the code for the RcvRawDta() 
subprocedure -- which, of course, is something that you wrote, and is 
not part of HTTPAPI.


>    the value of RC, returned from saveproc is 8191, while the value of
>    wwRecSize is 8192.  I tried to debug the saveproc routine, but am
>    having no luck in finding the thing.  Can someone give me some
>    direction here?
 >
>    BTW, my post routine looks like this:
> 
>    rc = http_url_post_raw(
>           'https://copyws.cendant.com/B2BGateway/service/XMLSelect'
>         : %addr(XMLdata)
>         : %len(%trim(XMLdata))
>         : 1
>         : %paddr(RcvRawDta)
>         : 90
>         : HTTP_USERAGENT
>         : 'text/xml; charset=utf-8'
>         : '"http://webservices.galileo.com/SubmitXml";');
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.5.1/765 - Release Date: 4/17/2007
5:20 PM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.5.1/765 - Release Date: 4/17/2007
5:20 PM
 

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