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

Re: [Ftpapi] [EXTERNAL] HTTPAPI https question



Never tried to call HTTPAPI from a stored procedure, but I’d guess that you should check the activation group of all involved components. They should probably all use the same value, i.e. a named activation group or *CALLER.

If different activation groups are used that could potentially cause problems.

Something to check at least…

 

Fra: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> På vegne af Lawrence Loz
Sendt: 10. marts 2020 14:19
Til: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Emne: [EXTERNAL] [Ftpapi] HTTPAPI https question

 

Hi,

 

I’ve been asked to look at a performance issue with some webservice service programs written by another programmer in our company who has now moved on. They are written using HTTPAPI and are calling https urls which in this instance happen to be a website within our company also, but not on the iseries.

 

The problem is that on the 1st call the process takes about 10 seconds, but on subsequent calls it only takes about 3 seconds. This seems to be happening on all of webservices written using HTTPAPI, but I am concentrating on one in the hope that, fix that and the others will follow suit.

 

Is there any way of reducing the overhead on the 1st call?

 

The company website calls the iseries using stored procedures, the iseries then does a number of webservice calls and processes, but the website has a 30 second timeout and so the web site often fails on the 1st call because of timeout even through the iseries is eventually succesful, but is then successful on subsequent calls as the iseries processes these within the timeout limit.

By calling the stored procedure direct, observing the timing of the SQL and also looking at the httpapi.log in debug, I’ve arrived at timings.

 

If there’s anything you can suggest to alter in the way we are using HTTPAPI, I’d be really grateful.

 

I’ve copied a section of the RPG code below, to hopefully help.

 

Thanks,               Lawrence

 

http_setCCSIDs(1208: 0);                                      

w#logfile =                                                   

            '/webservices/'+%subst(#1Library:2:3)+            

               '/http_api_log/' + %char(%timestamp:*ISO0)+    

               '-CardUnload.txt';                             

http_debug(*ON:w#logfile);                                    

http_use_cookies(*OFF);                                       

w#tempFile = http_tempfile(); 

rc = http_post( w#endpoint                         

              : %addr(SOAP) + VARYINGDATAOFFSET    

              : %len(SOAP)                         

              : %trim(w#tempfile)                  

              : HTTP_TIMEOUT                       

              : HTTP_USERAGENT                     

              : 'text/xml; charset=UTF-8'          

              : '""' );                            

w#fd = open( %trim(w#tempFile)                     

             : O_CREAT + O_RDWR + O_EXCL           

             : S_IRWXU );                           

                                                    

if (rc<>1);                                          

………….

 

//LL01- https_cleanup();            //*  we did have this in but have removed it and it doesn’t seem to make any difference either way *//

                             

 

-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi