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

Re: http_url_post question




Hello Scott,
I'm working with your EXAMPLE4 program.  You set the variable DATA using
stringed literals.  I sent that data to my customer as a test, and they
were happy with the results.  Not sure what format it's going out as, but
that's what I need.  So now I have an fixed record length XML formatted
database file that I would like to read, load into DATA, and send.  So I'm
thinking I have to read the file, eliminate the white space between
records, etc.  I'm not sure how to determine the size of the variable DATA,
that is to be loaded and sent.  The file being sent can be any number of
records, basically a bunch of extracted invoices based on a date range.  I
can fudge it all, but would like to use the best solution.

Also, from your response below, is there documentation on all the different
functions available?   I didn't know the ones you mention below existed.

Thanks again for all you help,
Tim




                                                                           
             Scott Klement                                                 
             <sk@scottklement.                                             
             com>                                                       To 
             Sent by:                  HTTPAPI and FTPAPI Projects         
             ftpapi-bounces@li         <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>     
             sts.scottklement.                                          cc 
             com                                                           
                                                                   Subject 
                                       Re: http_url_post question          
             04/04/2007 04:56                                              
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
                HTTPAPI and                                                
              FTPAPI Projects                                              
             <ftpapi@xxxxxxxxx                                             
              ttklement.com>                                               
                                                                           
                                                                           




Hi Tim,

Do you want to convert the database file to ASCII?  Should it be in any
particular format?   Or do you want to simply read the raw bytes that make
up each record and send them, unmodified, to the HTTP server?

If you want them to be converted to ASCII, and transformed into a text
file, I suggest taking two steps:

    a) Use CPYTOIMPF to convert the PF to a nice IFS stream file, formatted
       in ASCII the way you need it.

    b) Use http_url_post_stmf() to send the stream file to the HTTP server.

On the other hand, if you want to read a PF or LF directly and send the
raw bytes without any sort of transformation, then I'd recommend using
the http_url_post_raw2() API, and supply your own subprocedures that read
the file (so you can read the database records with your own RPG code) and
that save the response.  (not sure what sort of response you expect to
receive, so I won't try to explain what to do with it...)

--
Scott Klement  http://www.scottklement.com

On Wed, 4 Apr 2007, GornallTD@xxxxxxxxxxxxxxxxxxxx wrote:
>
> Can I use http_url_post to post a native OS/400 type file directly from
the
> iseries?  I modified one of Scott's example programs to test a post to a
> customers web site, and it all worked well.  The file sent was just hard
> coded within the program.   What's the best way to load up and database
> file and send?  The file will be variable in size and sent on a daily
> basis.
-----------------------------------------------------------------------
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
-----------------------------------------------------------------------