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

RE: R: Base64



Or perhaps %Addr(value.buf)? 

-----Original Message-----
From: Ron [mailto:ron@xxxxxxxxxxxx] 
Sent: Wednesday, June 08, 2011 10:18 AM
To: 'HTTPAPI and FTPAPI Projects'
Subject: RE: R: Base64


I think your issue is that you are trying to pass an alpha parameter to
base64_decode when the procedure requires an address to memory location. I'm
not that familiar with built-in parsing found in HTTPAPI because we use IBM
SAX parser wrapped by our own procedures. You might want to use Value.data
as parameter 1?


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Bing@xxxxxxxxxx
Sent: Wednesday, June 08, 2011 9:26 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: R: Base64

Hi Luciano
I get a new problem now. I try to make as descripted in Parse innerxml in
base64 format.

> P GetInnerDoc     B                   export 
> D GetInnerDoc     PI 
> D   filename                    50a   varying 
> D   depth                       10I 0 value 
> D   name                      1024A   varying const 
> D   path                     24576A   varying const 
> D   value                             likeds(Element_Val_t) 
> D   Attrs                         *   dim(32767) 
> D                                     const options(*varsize) 
> D fd              s             10i 0 
> D fd3             s             10I 0 
> D len             s             10I 0 
> D buf             s          32768A 
> D outbuf          S          24576A 
> D outlen          S             10I 0 
> 
>  /free
>
>    if path = '/soapenv:Envelope/soapenv:Body/' 
>            + 'rs:getContentResponse'; 
>      if (name = 'content:content'); 
>        fd = open( filename 
>                  : O_CREAT + O_TRUNC + O_WRONLY + O_CCSID 
>                    + O_TEXTDATA + O_TEXT_CREAT 
>                  : S_IRUSR + S_IWUSR 
>                  : 819 
>                  : 0 ); 
>        // FIXME: Add error handling. 
> 
>        outlen = base64_decode( value.buf 
>                  : value.len 
>                  : %addr(outbuf) 
>                  : %size(outbuf) );
> 
>        callp write(fd: %addr(outbuf): outlen);
>
>        callp close(fd); 
>      endif; 
>    endif;
>  /end-free 
> P                 E 

Element_Val_t is not defined. I defined this on top of my program.
D Element_Val_t   ds                  qualified 
D   data                          * 
D   buf                      32768A 
D   len                         10i 0 
When I compile my program, I get error message.
*RNF7536 30   3125 028300  The type of parameter 1 specified for the call 
does not 
                           match the prototype.  
Parameter 1 is value.buf. 

Can you help me with this?

Best regards
Y. B. Chang




"Luciano Vigna" <luciano.vigna@xxxxxxxxx> Sent by:
ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
08.06.2011 11:05
Please respond to
HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>


To
"'HTTPAPI and FTPAPI Projects'" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx> cc

Subject
R: Base64






Hi Chang,

Sorry for my simply question, but did you insert these statements in your
program:

    h BNDDIR('HTTPAPI':'BASE64':'QC2LE')

and / or

     /copy qrpglesrc,base64_h

I have merged BASE64 in my source library, I think that you can check my
compile operations:

CRTRPGMOD MODULE(xx/BASE64R4) 
          SRCFILE(xx_SRC/QRPGLESRC) 
          DBGVIEW(*LIST) 
 
CRTSRVPGM SRVPGM(xx/BASE64R4) 
          SRCFILE(xx_SRC/QSRVSRC) 
 
CRTBNDDIR BNDDIR(xx/BASE64) 
 
ADDBNDDIRE BNDDIR(xx/BASE64) 
           OBJ((xx/BASE64R4 *SRVPGM))


For me work very well, hope this serve,

Regards
Luciano



-----Messaggio originale-----
Da: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Per conto di Bing@xxxxxxxxxx
Inviato: mercoledì 8 giugno 2011 09:46
A: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Oggetto: Base64

Hello
I used httpapi a few times. It worked. Thanks!
Now I have an UPS-project. Via XML/Webservices send I a shipment and get
shipmentresponse back with a label that is encoded with base64. I downloaded
your program BASE64_H and BASE64R4, and compiled BASE64R4.
CRTRPGMOD MODULE(LIBHTTP/BASE64R4) SRCFILE(LIBHTTP/QRPGLESRC)
DBGVIEW(*LIST)
CRTSRVPGM SRVPGM(LIBHTTP/BASE64R4) SRCFILE(LIBHTTP/QSRVSRC) CRTBNDDIR
BNDDIR(LIBHTTP/BASE64) AUT(*ALL) ADDBNDDIRE BNDDIR(LIBHTTP/BASE64)
OBJ((LIBHTTP/BASE64R4 *SRVPGM))

So long every thing is ok. When I compiled my own program, I got error
message.

Ownership of object QRNFER in QTEMP type *USRSPC changed. 
Ownership of object QRNFEF in QTEMP type *USRSPC changed. 
Ownership of object UPSSND1 in QTEMP type *MODULE changed. 
Definition not found for symbol 'BASE64_DECODE'. 
Program UPSSND1 in library SYENDRE not created. 
Compilation failed. Program UPSSND1 not created in library SYENDRE. 
Program UPSSND1 in library SYENDRE not created. 
Compilation failed. Program UPSSND1 not created in library SYENDRE. 

Please tell me which step I did wrong.

Best regards
Y. B. Chang

-----------------------------------------------------------------------
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
-----------------------------------------------------------------------