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

Field of type CLOB



   Hi! Mr. SCOTT I enclose them mine pgm. Modified EXAMPLE2 is following:
   I ASK IF And POSSIBLE TO USE In the PGM. ATTACHED A FIELD OF TYPE CLOB
   NOW THE FIELD "XDOC" IS A TYPE VARCHAR,
   I CAN MODIFY THE TYPE OF THE FIELD "XDOC" IN TYPE CLOB?
   WHAT IS THE MODIFY?
   H DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR('HTTPAPI')

   FDocXml    IF   F32740        DISK

   D/copy qrpglesrc,httpapi_h

   D cmd             pr                  extpgm('QCMDEXC')
   D  command                     200A   const
   D  length                       15P 5 const

   D CRLF            C                   CONST(x'0D25')
   D rc              s             10I 0
   D msg             s             52A

   D Enc             s                   like(HTTP_URL_ENCODER)
   D myPointer       s               *
   D dataSize        s             10I 0

   IDocXml    NS
   I                                  1    3  Tipo
   I                                  632740  Xdoc

   c                   open(e)   DocXml
   c                   read      DocXml

   **
    ** To do URL encoding data, you must create a "URL
   Encoder"
    ** and then use it to encode each variable of the web
   form
    ** as
   follows:
    **



   C                   eval      Enc =
   http_url_encoder_new


   c                   callp     http_url_encoder_addvar(
   Enc
   c                                                  :
   'xmlString'
   c                                                  :
   %addr(Xdoc)
   c                                                  :
   %len(%trimr(Xdoc))
   c                   callp     http_url_encoder_addvar_s(
   Enc
   c                                                  :
   'type'
   c                                                  : tipo
   )


    **
    ** The http_url_encoder_getptr() routine can be used to get a
    ** pointer to the encoded data.  This is especially useful for
    ** the http_url_post() function.
    **
   c                   callp     http_url_encoder_getptr( Enc
   c                                                    : myPointer
   c                                                    : dataSize )

    **
    **  The http_url_post() function does an HTTP POST operation
    **  sending any data at the pointer you specify.
    **
    **  The results, in this case, are saved to the IFS in a file
    **  called '/tmp/result.xml'
    *
   c                   eval      rc = http_url_post(
   c                              '[1]http://10.1.1.199:9081/AMMWeb/' +
   c                                  'FileUploadServlet?'
   c                               + http_url_encoder_getstr(Enc)
   c                             : myPointer
   c                             : dataSize
   c                             : '/tmp/result.xml' )
   c                   if        rc <> 1
   c                   eval      msg = http_error
   c                   dsply                   msg
   c                   else
   c                   callp     cmd('DSPF ''/tmp/result.xml''': 200)
   c                   endif

    **
    ** When done, make sure you call this function to free up
    ** the memory that the URL Encoder used.
    **
   c                   callp     http_url_encoder_free(Enc)

   c                   close     DocXml
   c                   eval      *inlr = *on
   Thanks

   Antonio
     _________________________________________________________________

   L'email della prossima generazione? Puoi averla con la [2]nuova Yahoo!
   Mail

References

   1. http://10.1.1.199:9081/AMMWeb/
   2. http://us.rd.yahoo.com/mail/it/taglines/hotmail/nowyoucan/nextgen/*%20http://it.docs.yahoo.com/nowyoucan.html
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------