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

Re: Ftpapi Digest, Vol 37, Issue 28



   Yes that is waht I endup doing.. Thnaks for your help...

   ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
   Sent by: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx

   07/24/2009 01:00 PM

                             Please respond to
                       ftpapi@xxxxxxxxxxxxxxxxxxxxxx

                                                                       To

   ftpapi@xxxxxxxxxxxxxxxxxxxxxx

                                                                       cc

                                                                  Subject

   Ftpapi Digest, Vol 37, Issue 28

   Send Ftpapi mailing list submissions to
                   ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   To subscribe or unsubscribe via the World Wide Web, visit
                   http://www.scottklement.com/mailman/listinfo/ftpapi
   or, via email, send a message with subject or body 'help' to
                   ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
   You can reach the person managing the list at
                   ftpapi-owner@xxxxxxxxxxxxxxxxxxxxxx
   When replying, please edit your Subject line so it is more specific
   than "Re: Contents of Ftpapi digest..."
   Today's Topics:
     1. Re: FTP API (Charles Wilt)
     2. Google Translate API's (hr@xxxxxxxxxxxx)
     3. Re: Google Translate API's ... more (hr@xxxxxxxxxxxx)
     4. Re: Google Translate API's (Scott Klement)
   ----------------------------------------------------------------------
   Message: 1
   Date: Thu, 23 Jul 2009 16:01:25 -0400
   From: Charles Wilt <charles.wilt@xxxxxxxxx>
   Subject: Re: FTP API
   To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
   Message-ID:

   <fa303d750907231301m4bd24afer40353b9cd5d33703@xxxxxxxxxxxxxx>
   Content-Type: text/plain; charset=ISO-8859-1
   Use the IFS path name for the QSYS library object...
   /QSYS.LIB/MYLIB.LIB/MYFILE.FILE/MYMBR.MBR
   HTH,
   Charles
   On Thu, Jul 23, 2009 at 9:12 AM, <Sunil_Kumar@xxxxxxxxx> wrote:
   >
   > ? At present we are testing FTPAPI function but I noticed that there
   is
   > ? no function written for LCD and namefmt etc .. We are connecting
   from
   > ? AS/400 to non as/400 servers.
   > ? Every time when we call api FTP_get it brings the file to IFS
   folder
   > ? but we want it in AS/400 Library .
   > ? Please tell us How can I use API for NAMFMT 0 for AS/400 to know
   ?get
   > ? the file to the AS/400 library instead of ?IFS .. also How do I
   run
   > ? command like LCD to change local directory .
   > ? Thanks in ?advance for your help.
   > ? regards
   > ? Sunil
   > ? .
   >
   **********************************************************************
   ********
   >
   > The ?information contained in this electronic communication and any
   > accompanying document is confidential, may be attorney-client
   privileged,
   > and is intended only for the use of the addressee. ?It is the
   property of
   > Ryder System, Inc. ?Unauthorized use, disclosure or copying of this
   > communication, or any part of it, is strictly prohibited and may be
   > unlawful. ?If you have received this communication in error, please
   notify
   > the sender immediately by return email, and destroy this
   communication and
   > all copies of it, including all attachments. ?Electronic
   communication may
   > be susceptible to data corruption, interception and unauthorized
   tampering
   > and Ryder disclaims all liability of any kind for such actions or
   any
   > consequences that may arise directly or indirectly therefrom.
   >
   **********************************************************************
   ********
   >
   >
   ----------------------------------------------------------------------
   -
   > This is the FTPAPI mailing list. ?To unsubscribe, please go to:
   > http://www.scottklement.com/mailman/listinfo/ftpapi
   >
   ----------------------------------------------------------------------
   -
   >
   >
   ------------------------------
   Message: 2
   Date: Fri, 24 Jul 2009 00:29:32 +0200
   From: hr@xxxxxxxxxxxx
   Subject: Google Translate API's
   To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
   Message-ID:

   <OFD2CECD32.BF6050EA-ONC12575FC.0076A9E4-C12575FC.0079B7E4@xxxxxxxxxxx
   u>

   Content-Type: text/plain; charset="iso-8859-1"
   Hi, I'm building a Google Translater, but has run into trouble with
   the url that is rejected whatever I do:
   Has anybody any idears ?
   Regards
   Henrik
   If I from my browser (FF because IE dosn't understand google JSON
   responces) runs
   this url:
   http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=al
   fanumerisk&langpair=da|en
   or
   http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=al
   fanumerisk&langpair=da%7Cen
   I get this result:
   {"responseData": {"translatedText":"alphanumeric"}, "responseDetails":
   null, "responseStatus": 200}
   If I do anything illegal in the url google responce with
   {"responseData": null, "responseDetails": "invalid translation
   language
   pair", "responseStatus": 400}
   But actually google also respond with a HTTP 400 error code
   Now my LIBHTTP program, what ever I do, responds with a HTTP 400 error
   code and
   this debug file:
   HTTPAPI Ver 1.23 released 2008-04-24
   OS/400 Ver V5R4M0

   New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819.
   ProtLoc=0
   http_url_get(): entered
   http_persist_open(): entered
   http_long_ParseURL(): entered
   DNS resolver retrans: 2
   DNS resolver retry  : 2
   DNS resolver options: x'00000136'
   DNS default domain: Shoe-D-Vision.net
   DNS server found: 192.168.0.41
   DNS server found: 192.168.0.42
   http_persist_get(): entered
   http_long_ParseURL(): entered
   do_get(): entered
   httpdate(): entered
   GET /ajax/services/language/translate?v=1.0&q=ALFA&langpair=da%7Cen
   HTTP/1.1
   Host: ajax.googleapis.com
   If-Modified-Since: Tor, 23 Jul 2009 23:29:07 GMT
   User-Agent: http-api/1.23
   Content-Type: text/html; charset=UTF-8
   recvresp(): entered
   HTTP/1.1 400 Bad Request
   Content-Type: text/html; charset=UTF-8
   Content-Length: 145
   Date: Thu, 23 Jul 2009 21:30:03 GMT
   Expires: Thu, 23 Jul 2009 21:30:03 GMT
   Cache-Control: public, max-age=0
   X-Content-Type-Options: nosniff
   Server: GFE/2.0
   SetError() ?13: HTTP/1.1 400 Bad Request
   recvdoc parms: identity 145
   header_load_cookies() entered
   recvdoc(): entered
   SetError() ?0:
   <HTML> <HEAD> <TITLE>Bad Request</TITLE> </HEAD> <BODY
   BGCOLOR="#FFFFFF"
   TEXT="#000000"> <H1>Bad Request</H1> <H2>Error 400</
   SetError() ?13: HTTP/1.1 400 Bad Request
   http_close(): entered

   H DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR('HTTPAPI')
   *define WEBFORMS
   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 ver             s             10A   inz('1.0')
   d question        s            256A   inz('ALFA')
   d langpair        s             20A
   d srclng          s             10A   inz('da')
   d tolng           s             10A   inz('en')
   d date            s               Z
   d url             s          32767A
   d urlEncoded      s                   like(http_url_encoder)
   D myPointer       s               *
   D dataSize        s             10I 0
   /free
    http_debug(*on);
    // HTTP_setCCSIDs(1208:1208);  // CCSID 1208 = UTF-8
    date = %timestamp;
    // Create URL
    urlEncoded = http_url_encoder_new();
    http_url_encoder_addvar(urlEncoded
     :'v'
     :%addr(ver)
     :%len(%trimr(ver))
     );
    http_url_encoder_addvar(urlEncoded
     :'q'
     :%addr(question)
     :%len(%trimr(question))
    );
    langpair = %trim(srclng) + '|' + %trim(tolng);
    http_url_encoder_addvar(urlEncoded
     :'langpair'
     :%addr(langpair)
     :%len(%trimr(langpair))
    );
    url = 'http://ajax.googleapis.com/ajax/services/language/translate?'
     + http_url_encoder_getstr(urlEncoded);
    rc = http_url_get(url
      :'/tmp/testpost.html'
      :HTTP_TIMEOUT
      :HTTP_USERAGENT
      :date
     // :'text/html;'
      :'text/html; charset=UTF-8'
    );
    http_url_encoder_free(urlEncoded);
    if rc <> 1;
      msg = http_error;
      dsply  msg;
    else;
      cmd('DSPF ''/tmp/testpost.html''':200);
    endif;
    *inlr = *on;
   /end-free
   Henrik R?tzou
   HR Software Development
   Ved Stampedammen 39
   DK 2970 H?rsholm
   Denmark
   E-mail: hr@xxxxxxxxxxxx
   Phone: +45 2714 8449
   Homepage
   -------------- next part --------------
     Hi, I'm building a Google Translater, but has run into trouble with
     the url that is rejected whatever I do:
     Has anybody any idears ?
     Regards
     Henrik
     If I from my browser (FF because IE dosn't understand google JSON
     responces) runs
     this url:

   http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=al
     fanumerisk&langpair=da|en
     or

   http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=al
     fanumerisk&langpair=da%7Cen
     I get this result:
     {"responseData": {"translatedText":"alphanumeric"},
   "responseDetails":
     null, "responseStatus": 200}
     If I do anything illegal in the url google responce with
     {"responseData": null, "responseDetails": "invalid translation
     language pair", "responseStatus": 400}
     But actually google also respond with a HTTP 400 error code
     Now my LIBHTTP program, what ever I do, responds with a HTTP 400
   error
     code and
     this debug file:
     HTTPAPI Ver 1.23 released 2008-04-24
     OS/400 Ver V5R4M0
     New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819.
     ProtLoc=0
     http_url_get(): entered
     http_persist_open(): entered
     http_long_ParseURL(): entered
     DNS resolver retrans: 2
     DNS resolver retry  : 2
     DNS resolver options: x'00000136'
     DNS default domain: Shoe-D-Vision.net
     DNS server found: 192.168.0.41
     DNS server found: 192.168.0.42
     http_persist_get(): entered
     http_long_ParseURL(): entered
     do_get(): entered
     httpdate(): entered
     GET /ajax/services/language/translate?v=1.0&q=ALFA&langpair=da%7Cen
     HTTP/1.1
     Host: ajax.googleapis.com
     If-Modified-Since: Tor, 23 Jul 2009 23:29:07 GMT
     User-Agent: http-api/1.23
     Content-Type: text/html; charset=UTF-8
     recvresp(): entered
     HTTP/1.1 400 Bad Request
     Content-Type: text/html; charset=UTF-8
     Content-Length: 145
     Date: Thu, 23 Jul 2009 21:30:03 GMT
     Expires: Thu, 23 Jul 2009 21:30:03 GMT
     Cache-Control: public, max-age=0
     X-Content-Type-Options: nosniff
     Server: GFE/2.0
     SetError() ?13: HTTP/1.1 400 Bad Request
     recvdoc parms: identity 145
     header_load_cookies() entered
     recvdoc(): entered
     SetError() ?0:
     <HTML> <HEAD> <TITLE>Bad Request</TITLE> </HEAD> <BODY
     BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Bad Request</H1> <H2>Error
   400</
     SetError() ?13: HTTP/1.1 400 Bad Request
     http_close(): entered
     H DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR('HTTPAPI')
      *define WEBFORMS
     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 ver             s             10A   inz('1.0')
     d question        s            256A   inz('ALFA')
     d langpair        s             20A
     d srclng          s             10A   inz('da')
     d tolng           s             10A   inz('en')
     d date            s               Z
     d url             s          32767A
     d urlEncoded      s                   like(http_url_encoder)
     D myPointer       s               *
     D dataSize        s             10I 0
      /free
       http_debug(*on);
       // HTTP_setCCSIDs(1208:1208);  // CCSID 1208 = UTF-8
       date = %timestamp;
       // Create URL
       urlEncoded = http_url_encoder_new();
       http_url_encoder_addvar(urlEncoded
        :'v'
        :%addr(ver)
        :%len(%trimr(ver))
        );
       http_url_encoder_addvar(urlEncoded
        :'q'
        :%addr(question)
        :%len(%trimr(question))
       );
       langpair = %trim(srclng) + '|' + %trim(tolng);
       http_url_encoder_addvar(urlEncoded
        :'langpair'
        :%addr(langpair)
        :%len(%trimr(langpair))
       );
       url =
   'http://ajax.googleapis.com/ajax/services/language/translate?'
        + http_url_encoder_getstr(urlEncoded);
       rc = http_url_get(url
         :'/tmp/testpost.html'
         :HTTP_TIMEOUT
         :HTTP_USERAGENT
         :date
        // :'text/html;'
         :'text/html; charset=UTF-8'
       );
       http_url_encoder_free(urlEncoded);
       if rc <> 1;
         msg = http_error;
         dsply  msg;
       else;
         cmd('DSPF ''/tmp/testpost.html''':200);
       endif;
       *inlr = *on;
      /end-free
     Henrik R?tzou
     HR Software Development
     Ved Stampedammen 39
     DK 2970 H?rsholm
     Denmark
     E-mail: hr@xxxxxxxxxxxx
     Phone: +45 2714 8449
     [1]Homepage
   References
     1. http://powerext.com/
   ------------------------------
   Message: 3
   Date: Fri, 24 Jul 2009 16:12:18 +0200
   From: hr@xxxxxxxxxxxx
   Subject: Re: Google Translate API's ... more
   To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
   Message-ID:

   <OFE39BB008.A7264AD7-ONC12575FD.004DD408-C12575FD.004C3723@xxxxxxxxxxx
   u>

   Content-Type: text/plain; charset="us-ascii"
   Here are request header and response header from  FireFox and the
   iSeries
   source program from
   the test:
   http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=al
   fanumerisk&langpair=da|en
   Host: ajax.googleapis.com
   User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; da; rv:1.9.0.12)
   Gecko/2009070611 Firefox/3.0.12
   Accept:
   text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   Accept-Language: da,en-us;q=0.7,en;q=0.3
   Accept-Encoding: gzip,deflate
   Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
   Keep-Alive: 300
   Connection: keep-alive
   Cache-Control: no-cache, no-store, max-age=0, must-revalidate
   Pragma: no-cache
   Expires: Fri, 01 Jan 1990 00:00:00 GMT
   Date: Thu, 23 Jul 2009 22:17:44 GMT
   Content-Type: text/javascript; charset=utf-8
   X-Backend-Content-Length: 18
   X-Embedded-Status: 200
   Content-Encoding: gzip
   X-Content-Type-Options: nosniff
   Content-Length: 99
   Server: GFE/2.0
   Regards
   henrik
   -------------- next part --------------
     Here are request header and response header from  FireFox and the
     iSeries source program from
     the test:

   http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=al
     fanumerisk&langpair=da|en
     Host: ajax.googleapis.com
     User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; da;
   rv:1.9.0.12)
     Gecko/2009070611 Firefox/3.0.12
     Accept:
     text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
     Accept-Language: da,en-us;q=0.7,en;q=0.3
     Accept-Encoding: gzip,deflate
     Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
     Keep-Alive: 300
     Connection: keep-alive
     Cache-Control: no-cache, no-store, max-age=0, must-revalidate
     Pragma: no-cache
     Expires: Fri, 01 Jan 1990 00:00:00 GMT
     Date: Thu, 23 Jul 2009 22:17:44 GMT
     Content-Type: text/javascript; charset=utf-8
     X-Backend-Content-Length: 18
     X-Embedded-Status: 200
     Content-Encoding: gzip
     X-Content-Type-Options: nosniff
     Content-Length: 99
     Server: GFE/2.0
     Regards
     henrik
   -------------- next part --------------
   An embedded and charset-unspecified text was scrubbed...
   Name: gtranslate.txt
   Url:
   http://www.scottklement.com/pipermail/ftpapi/attachments/20090724/2fd7
   d3a3/attachment.txt
   ------------------------------
   Message: 4
   Date: Fri, 24 Jul 2009 11:37:52 -0500
   From: Scott Klement <sk@xxxxxxxxxxxxxxxx>
   Subject: Re: Google Translate API's
   To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
   Message-ID: <4A69E360.1010206@xxxxxxxxxxxxxxxx>
   Content-Type: text/plain; charset=ISO-8859-1; format=flowed
   Hello Henrik,
   Please try changing your call to http_url_get() to look like this:
      rc = http_url_get(url: '/tmp/testpost.html');
   You are specifying some other parameters that are likely to be causing
   problems.  Try specifying only those two.
   Thanks!
   ------------------------------
   ----------------------------------------------------------------------
   -
   This is the FTPAPI mailing list digest.  To unsubscribe, go to:
   http://www.scottklement.com/mailman/listinfo/ftpapi
   ----------------------------------------------------------------------
   -
   End of Ftpapi Digest, Vol 37, Issue 28
   **************************************
******************************************************************************

The  information contained in this electronic communication and any
accompanying document is confidential, may be attorney-client privileged,
and is intended only for the use of the addressee.  It is the property of
Ryder System, Inc.  Unauthorized use, disclosure or copying of this
communication, or any part of it, is strictly prohibited and may be
unlawful.  If you have received this communication in error, please notify
the sender immediately by return email, and destroy this communication and
all copies of it, including all attachments.  Electronic communication may
be susceptible to data corruption, interception and unauthorized tampering
and Ryder disclaims all liability of any kind for such actions or any
consequences that may arise directly or indirectly therefrom.
******************************************************************************
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------