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

RE: recvdoc: saveproc: Not all data was written§



Here is the procedure:

P RequeteOgone    B                         
D RequeteOgone    PI                        
D   $PayID                      15A   value 
D   $Ope                         3A   value 
D Data            S           5000A   varying
 /free                                      
Data = 'ORDERID=' + %trim(P_order) +                     
       '&ALIAS=' + %Trim(P_Alias) +                      
       '&PSPID=BPX' + %Trim(Wpspid) +                    
       '&USERID=' + %Trim(Wuserid) +                     
       '&PSWD=' + %Trim(Wpswd) +                         
       '&AMOUNT=' + %Trim(%Editc(P_Amount:'Z')) +        
       '&CURRENCY=' + P_Devise +                         
       '&PM=PAYPAL';                                     
If $PayID <> *Blanks;                                    
  Data = %Trim(Data) +                                   
       '&PAYID=' + %Trim($PayID);                        
Endif;                                                   
Data = %Trim(Data) +                                     
       '&OPERATION=' + $Ope + '&RTIMEOUT=10' +           
       '&SHASign=' + Sha1;                               
                                                         
rc = http_url_post_raw('https://secure.ogone.com/ncol' + 
     '/prod/orderdirect.asp?' + data                     
     : %addr(data) + 2 
     : %len(%trim(data))      
     : 1                      
     : %paddr('INCOMING'));   
if (rc <> 1);                                           
  msg = http_error();                                   
  return;                                               
else;                                                   
  if retlen > 1;                                        
    callp http_xlate(retlen: retdata: TO_EBCDIC);       
                                                        
    Trouve = %Scan('PAYID="':retdata);                  
    If Trouve > 0;                                      
      Fin = %Scan('"':retdata:Trouve+8);                
      WPayId = %Subst(retdata:Trouve+7:Fin-Trouve-7);   
    Endif;                                              
  Endif;                                  
Endif;
/end-free         
P                 E

P                 E                         
 *                                          
P incoming        B                         
D incoming        PI            10I 0       
D   descriptor                  10I 0 value
D   data                      8192A   options(*varsize)                
D   datalen                     10I 0 value                            
                                                                       
 * Make sure we don't overflow the string:                             
c                   eval      retlen = (nextpos + datalen) - 1         
c                   if        retlen > %size(retdata)                  
c                   eval      datalen=datalen-(retlen-%size(retdata))  
c                   endif                                              
                                                                       
 * If there is nothing to write, return THAT...                        
c                   if        datalen < 1                              
c                   return    0                                        
c                   endif                                              
                                                                       
 * Here we add any data sent to the end of our 'retdata' string:       
c                   eval      %subst(retdata: nextpos) =               
c                                %subst(data:1:datalen)                
c                   eval      nextpos = nextpos + datalen              
                                                                       
 * We always return the amount of data that we wrote.   Note           
 *  that if http-api sees that we didn't write as much data as         
 *  it sent us, it'll abort the process with an error message.         
c                   return    datalen                                  
P                 E                                                    
-----Message d'origine-----
De : ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] De la part de Scott Klement
Envoyé : mardi 3 février 2015 17:42
À : HTTPAPI and FTPAPI Projects
Objet : Re: recvdoc: saveproc: Not all data was written§

Since errno=0, he's not running out of file handles (or getting any other IFS error.)

He must be using a 'raw' routine and his code is not returning the full 
length that was passed to it.   We need to see that routine to help further.


On 2/3/2015 10:36 AM, Thomas Raddatz wrote:
> Thomas,
>
> "Not all data was written" is a generic error message that does not 
> tell anything about the actual error. It is issued, when saveproc() 
> returns less bytes than expected:
>
>      eval      rc = saveproc( peFD
>                             : %addr(wwData)
>                             : wwLen )
>      if        rc < wwLen
>      callp     SetError(HTTP_RDWERR
>                        : 'errno is currently '
>                        + %trim(%editc(errno:'L')))
>      callp     SetError(HTTP_RDWERR:'recvdoc: saveproc:'+
>                 ' Not all data was written!')
>      return    -1
>      endif
>
> The actual error must be within the custom saveproc() that you specify 
> at http_url_post_raw(), parameter "peProc".
>
> I suggest to check the job log for additional information and to debug 
> your saveproc().
>
> Is it possible that your saveproc() saves the data to an IFS file and 
> that you do not properly close the file? This way you would run out of 
> file handles, which is an unrecoverable error for that you need to end the job.
>
> I am just thinking, because you mentioned that after the first error 
> it "occurs for all the following requests". Running out of file 
> handles might be one of these errors.
>
> Regards,
>
> Thomas.
>
> Am 03.02.2015 um 11:25 schrieb HIRSCH Thomas:
>>     Hi,
>>
>>
>>     We use httpapi for years with success.
>>
>>
>>     We meet now something very strange: a rpgle program sends successfully
>>     hundred of https requests using "http_url_post_raw" for years
>>
>>
>>     We need to amend this program and now the request is in an internal
>>     procedure (same issue with a subroutine).
>>
>>     The program runs well until a few hundred requests are sent and then
>>     the error "recvdoc: saveproc: Not all data was written§" occurs
>>
>>     When it occurs once then it occurs for all the following requests
>>
>>
>>     SetError() £13: HTTP/1.1 200 OK
>>
>>     recvdoc parms: identity 223
>>
>>     header_load_cookies() entered
>>
>>     recvdoc(): entered
>>
>>     SetError() £0:
>>
>>     <?xml version="1.0"?>
>>
>>     <ncresponse
>>
>>      orderID="E0P4860263354"
>>
>>      PAYID="1333249962"
>>
>>      PAYIDSUB="1"
>>
>>      NCSTATUS="0"
>>
>>      NCERROR="0"
>>
>>      NCERRORPLUS="!"
>>
>>
>>     SetError() £16: errno is currently 0
>>
>>     SetError() £16: recvdoc: saveproc: Not all data was written§
>>
>>     http_close(): entered
>>
>>
>>     Any idea ?
>>
>>
>>     Best regards
>>
>>     Thomas
>>
>>
>>
>> ---------------------------------------------------------------------
>> -- 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
> ----------------------------------------------------------------------
> -
>

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

--
*******************************************************************************************************************************************************
Ensemble adoptons des gestes responsables : N'imprimez ce mail que si nécessaire.

Les informations contenues dans ce message et les pièces jointes (ci-après dénommé le message) sont confidentielles et peuvent être couvertes par le secret professionnel. Si vous n'êtes pas le destinataire de ce message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie.
Si vous avez reçu ce message par erreur, nous vous remercions de le supprimer de votre système, ainsi que toutes ses copies, et d'en avertir immédiatement bon prix France par message de retour. Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur, altération, falsification ou virus. En conséquence, bon prix France décline toute responsabilité du fait des erreurs, altérations, falsifications ou omissions qui pourraient en résulter.

Consider the environment before printing this mail.

The information contained in this e-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message by error, please delete it and all copies from your system and notify the sender immediately by return e-mail. E-mail communications cannot be guaranteed to be timely secure, error or virus-free. The sender does not accept liability for any errors or omissions which arise as a result.
*******************************************************************************************************************************************************

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