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

Re: Help with HTTP API



Thanks Scott,
 
That was very helpfull, but I still getin the same error from the server attached the httpapi_debug file.
 
Jeff.

 
On 2/10/06, Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:
Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


> the Development iSeries that I'm working on in, is on V4R4M0 , I got an
> error with  the /free ...... /end-free stuff.
> Do I have to use diferent code no?

I don't have access to a computer that's as far out of date as V4R4, so I
don't know exactly what needs to be changed.  I think all you'll need to
do is convert it to fixed format.

Here's a fixed format version of the same program:

     H dftactgrp(*no) bnddir('LIBHTTP/HTTPAPI')

      /copy libhttp/qrpglesrc,httpapi_h

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

     D rc              s             10I 0
     D msg             s             52A
     D Enc             s                   like(HTTP_URL_ENCODER)
     D data            s               *
     D size            s             10I 0

     C                   eval      *inlr = *On

     C                   eval      Enc = http_url_encoder_new
     c                   callp     http_url_encoder_addvar_s(
     c                                Enc  : 'sUsuario': 'bancon')
     c                   callp     http_url_encoder_addvar_s(
     c                                Enc  : 'cClave': 'bancon')
     c                   callp     http_url_encoder_addvar_s(
     c                                Enc  : 'iNumeroDeCliente': '2356')

     c                   callp     http_url_encoder_getptr(
     c                                Enc  : data : size )

     c                   eval      rc = http_url_post(
     c                                 'http://200.30.178.70'
     c                               + '/service.asmx'
     c                               + '/BuscarClientePorNumeroCliente'
     c                               : data
     c                               : size
     c                               : '/tmp/httptest.html' )

     c                   callp     http_url_encoder_free(enc)

     c                   if        rc <> 1
     c                   eval      msg = http_error
     c                   dsply                   msg
     c                   return
     c                   endif

     c                   callp     cmd('DSPF ''/tmp/httptest.html''': 200)
     c                   return


Please compare the original program with this one so you can see how easy
it was to convert from free format to fixed format.  Almost all of the
examples you'll see posted in the future will be in free format, so
understanding how to convert between them will be a good thing to know.


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------

Èãã×Á×É@å??@ñKñóKñ@?????¢??@òððö`ðñ`ðó
%
%?££?m¤??m??¢£M]z@??£????
%?££?m???¢?¢£m????M]z@??£????
%?££?m????m×??¢?äÙÓM]z@??£????
%?££?m???¢?¢£m??¢£M]z@??£????
%?££?m????m×??¢?äÙÓM]z@??£????
%??m??¢£M]z@??£????
%×Öâã@a¢??¥???K?¢?§a¤¢???Ã????£?×??Õ¤????Ã????£?@Èãã×añKñ
%È?¢£z@òððKóðKñ÷øK÷ð
%ä¢??`Á???£z@?££?`???añKñô
%Ã??£??£`ã¨??z@£?§£a§??
%ŧ???£z@ñðð`???£??¤?
%Ã??£??£`Ó???£?z@ñôó
%
%
???¥??¢?M]z@??£????
%â?£Å????M]@iôóz@Ã???ãÃ×m????z@Õ?@ñðð`Ã??£??¤?@M?????@???????]
%¢??????M]z@??£????
%lÁòlÅôlÁòlÁôløñlùùløùlùö~løòløñlùõløólùölùõPløólÃólùóløñlÁõløõ~løòløñlùõløólùölùõPløùlÄõlÁôlùôløõlùùlùölÃôløõlÃólùóløùløõlùõlÁóløõ~lÆòlÆólÆõlÆö

???¥??¢?M]z@??£????
%HTTP/1.1 400 Bad Request ( The data is invalid.  )
Via: 1.1 SISTEMATICASPS
Connection: close
Proxy-Connection: close
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 1946  


â?£Å????M]@iñóz@HTTP/1.1 400 Bad Request ( The data is invalid.  )
%?££?m???¢?M]z@??£????
%