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

http_url_post_stmf



   Hi
   Hope you can help me.
   I have a url that i want to execute, but do not want to wait for it to
   complete. The url will create a pdf report in a folder somewhere and my
   program doesn't need to wait for it to complete.
   How can i tell it to run in the background or not to wait for a URL
   post/ get to complete?
   Here is my code:
   rc = http_url_post_stmf('http://p6devc01:8050/p6rpt/TestCerts/'
                                    + 'TestCertPublishPlx.aspx?'
                                    + 'REPORT=TESTCERTPUBLISH&'
                                    + 'PARAMETER1=20263&'
                                    + 'PARAMETER2=1&PARAMETER3=TUVEXT'
                                    : '/tmp/httptest.txt'
                                    : '/tmp/httptest1.html'
                                    : HTTP_TIMEOUT
                                    : HTTP_USERAGENT
                                    : ContentType );
                if rc=302;
                   vServiceURL = http_redir_loc();
                   rc = http_url_post_stmf(vServiceURL
                                    : '/tmp/httptest.txt'
                                    : '/tmp/httptest1.html'
                                    : HTTP_TIMEOUT
                                    : HTTP_USERAGENT
                                    : ContentType );
                    PrintMe = %TRIM(vServiceURL);
                    Except Print;
                   //rc = http_url_get( url . . .  );
                endif;
   Regards
   Derick Venter
   Applications Developer IV

   [cid:_4_09F5198C09F5158C004A541142257C7B]

   Systems Integration
   Tel: +27 (13) 247 2816 Fax: +27 (0) 86 573 2274
   Cell: +27 (0) 83 458 6599
   Email: [1]derick.venter@xxxxxxxxxx
   [2]www.gijima.com
   From:        Ceriani Matteo <m.ceriani@xxxxxxxxx>
   To:        HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
   Date:        2013/12/19 12:28 PM
   Subject:        RE: Error using  http_url_get
   Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
     __________________________________________________________________

   Hello Scott and Sean,
   My version of  HTTPAPI is 1.23 released 2008-04-24 OS/400 Ver V6R1M0
   Is It old?
   I've activated the debug and I stressed the program:
   http_debug(*on:'/PUMART/dbg_purtsrcpgm.txt');
   When I go to launch the program and It goes wrong, this is not written
   to me debugging and it seemed very strange.
   So I went out of program and I did wrklnk '/PUMA*' and I take this CPF:

   CPFA0A4  (Error CPFA0A4.Too many open files for process.)
   At first on my session I've done wrkjob --> opz. 14
   But there isn't open file.
   So I ask to google help me!
   I've read a post with the same problem and i find the problem.
   In a program I do the open on my ifs .txt but i didn't close, beacause
   I was used a return instead of a leave...
   So I saturate open files my job, inizially I was though that should be
   a socket problem because I was misled variable error msg that was
   enhanced with "() Socket: Too many open files".
   Thank's to all availability.
   Merry Christmas and Happy New Year
   MC


   -----Original Message-----
   From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   [[3]mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott
   Klement
   Sent: giovedì 19 dicembre 2013 00:13
   To: HTTPAPI and FTPAPI Projects
   Subject: Re: Error using http_url_get
   Hello Matteo,
   For some reason, you are getting an error when you try to create a
   socket.  A socket is a tool used to read/write data to a network. (A
   socket is similar to a file, except a file is for reading/writing data
   to a hard drive, and a socket is for reading/writing data to a program
   over a network.)
   All error 4 means is that the system refused to create a socket.  To
   learn more about what has failed, please send us a debug/trace file.
   To do that, add http_debug(*on) into your code before you call any
   HTTPAPI routines. This will generate the trace file in an IFS file
   named
   /tmp/httpapi_debug.txt.   Please send a copy of that file to this
   mailing list -- it will tell us what error is occurring in opening a
   socket.
   -SK
   On 12/18/2013 2:14 AM, Ceriani Matteo wrote:
   >     Hi Scott,
   >
   >
   >
   >     I try to use rc = http_url_get(URL: link); and it works well, but
   after
   >     many time that I use it in interactive procedure, I obtain -1
   return
   >     value and using: http_error(err);
   >
   >     Err is value with "ERR = 4" and reading unix documentation I've
   >     understood that should be a problem on the open socket... is
   there a
   >     way to close then?
   >
   >     if i do on my system "ulimit -aH" i've for  unlimited    and if I
   do
   >     "ulimit -aS" I've 200 for open file/item.
   >
   >     thk's in advance.
   >
   >     Matteo
   >
   >
   >
   >     my code:
   >
   >
   >
   >     http_debug(*off:'/PUMART/dbg.txt');
   >
   >              rc = http_url_get(URL: link);
   >
   >              if rc = 302;
   >
   >                 url = http_redir_loc;
   >
   >                 rc = http_url_get(URL: link);
   >
   >              endif;
   >
   >              if rc <> 1 ;
   >
   >                 http_error(err);
   >
   >                 if err <> HTTP_NDAUTH;
   >
   >                    http_debug(*on:'/PUMART/dbg.txt');
   >
   >                    msg = HTTP_ERROR;
   >
   >                    return *on;
   >
   >                 endif;
   >
   >                 rc = http_getauth(basic: digest: realm) ;
   >
   >                 if rc < 0;
   >
   >                    msg = HTTP_ERROR ;
   >
   >                    return *on;
   >
   >                 endif ;
   >
   >                 userid = 'xxx';
   >
   >                 pass = 'xxx' ;
   >
   >                 if  Digest   ;
   >
   >                     http_setauth(HTTP_AUTH_MD5_DIGEST:
   >
   >                                          userid: pass);
   >
   >                 else;
   >
   >                      http_setauth(HTTP_AUTH_BASIC:
   >
   >                                           userid: pass);
   >
   >                endif ;
   >
   >                rc = http_url_get(URL: link);
   >
   >                if rc = 302;
   >
   >                   url = http_redir_loc;
   >
   >                   rc = http_url_get(URL: link);
   >
   >                endif;
   >
   >                IF  rc <> 1;
   >
   >                    http_debug(*on:'/PUMART/dbg.txt');
   >
   >                    eval      msg = HTTP_ERROR;
   >
   >                    return *on;
   >
   >                endif;
   >
   >              endif;
   >
   >
   >
   >
   ----------------------------------------------------------------------
   > - This is the FTPAPI mailing list.  To unsubscribe, please go to:
   > [4]http://www.scottklement.com/mailman/listinfo/ftpapi
   >
   ----------------------------------------------------------------------
   > -
   -----------------------------------------------------------------------
   This is the FTPAPI mailing list.  To unsubscribe, please go to:
   [5]http://www.scottklement.com/mailman/listinfo/ftpapi
   -----------------------------------------------------------------------
     __________________________________________________________________

   This e-mail is subject to the Columbus Stainless [Pty] Ltd Email Legal
   Notices available at:
   [6]http://www.columbus.co.za/EmailLegalNotice.htm.
     __________________________________________________________________

   This e-mail message has been scanned for Viruses and Content and
   cleared by MailMarshal
     __________________________________________________________________

References

   1. mailto:derick.venter@xxxxxxxxxx
   2. http://www.gijima.com/
   3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   4. http://www.scottklement.com/mailman/listinfo/ftpapi
   5. http://www.scottklement.com/mailman/listinfo/ftpapi
   6. http://www.columbus.co.za/EmailLegalNotice.htm

PNG image

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