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

Re: Ftpapi Digest, Vol 72, Issue 22



   I copied those values from debugger and after pasting them here, I
   changed only the ID and password values.


   On Sat, Jun 30, 2012 at 1:00 PM,
   <[1]ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx> wrote:

     Send Ftpapi mailing list submissions to
             [2]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
     To subscribe or unsubscribe via the World Wide Web, visit
             [3]http://scottklement.com/mailman/listinfo/ftpapi
     or, via email, send a message with subject or body 'help' to
             [4]ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
     You can reach the person managing the list at
             [5]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. http_url_encoder_addvar() (Donnie Sanders)
        2. Re: http_url_encoder_addvar() (Scott Klement)
     --------------------------------------------------------------------
     --
     Message: 1
     Date: Fri, 29 Jun 2012 21:25:50 -0400
     From: Donnie Sanders <[6]i5pgmranalyst@xxxxxxxxx>
     To: [7]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
     Subject: http_url_encoder_addvar()
     Message-ID:

     <CAP=[8]hzCWXwaJLvyUHJzGeqUfxxdk+Q76kWNZGwj24KJeDnhqc8A@mail.gmail.c
     om>
     Content-Type: text/plain; charset="iso-8859-1"
     All,
     This is my first attempt at posting data to a HTTP server and using
     http_url_post_xml.
     I believe my problem is that I'm getting an unexpected %09X inserted
     in my
     field when using http_url_encoder_addvar().
     Here's the related code:
     tst2 D enc             s                   like(HTTP_URL_ENCODER)
     tst2 D encoded_data    S               *
     tst2 D encoded_len     S             10I 0
          d xmlData         s          65535a   varying
     tst2   // URL encode the data.
     tst2     enc = http_url_encoder_new();
     tst2     http_url_encoder_addvar_s(enc : 'service' :
     'imessage_send');
     tst2     http_url_encoder_addvar_s(enc : 'cid' : %trim(pUserID));
     tst2     http_url_encoder_addvar_s(enc : 'pw'  : %trim(pPassword));
     tst2     http_url_encoder_addvar( enc
     tst2                            : 'xml'
     tst2                            : %addr(xmlData)
     tst2                            : %len(%trim(xmlData)) );
     tst2     // Get a pointer to the URL encoded data.
     tst2     http_url_encoder_getptr( enc
     tst2                            : encoded_data
     tst2                            : encoded_len);
              rc = http_url_post_xml ( %trim(pAddress)
                                    : encoded_data
                                    : encoded_len
                                    : *null
                                    : %paddr(EndOfElement)
                                    : *null
                                    : HTTP_TIMEOUT
                                    : HTTP_USERAGENT
                                    :
     'application/x-www-form-urlencoded');
     tst2     http_url_encoder_free(enc);
     In debug, the beginning of xmlData looks like:
     <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE
     pnet_imessage_send
     PUBLIC"-//PeopleNet//pnet_imessage_send""
     [9]http://open.peoplenetonline.com/dtd/pnet_imessage_send.dtd";>
     The beginning of encoded_data looks like:
     service=imessage_send&cid=1111&pw=password&xml=%09X%3C%3Fxml+version
     %3D%221.0%22+encoding%3D%22ISO-8859-1%22%3F%3E
     Am I correct in expecting it to look like this?
     service=imessage_send&cid=1111&pw=password&xml=%3C%3Fxml+version%3D%
     221.0%22+encoding%3D%22ISO-8859-1%22%3F%3E
     Thanks in advance,
     Donnie
     -------------- next part --------------
        All,
        This is my first attempt at posting data to a HTTP server and
     using
        http_url_post_xml.
        I believe my problem is that I'm getting an unexpected %09X
     inserted in
        my field when using http_url_encoder_addvar().
        Here's the related code:
        tst2 D enc             s                   like(HTTP_URL_ENCODER)
        tst2 D encoded_data    S               *
        tst2 D encoded_len     S             10I 0
             d xmlData         s          65535a   varying
        tst2   // URL encode the data.
        tst2     enc = http_url_encoder_new();
        tst2     http_url_encoder_addvar_s(enc : 'service' :
     'imessage_send');
        tst2     http_url_encoder_addvar_s(enc : 'cid' : %trim(pUserID));
        tst2     http_url_encoder_addvar_s(enc : 'pw'  :
     %trim(pPassword));
        tst2     http_url_encoder_addvar( enc
        tst2                            : 'xml'
        tst2                            : %addr(xmlData)
        tst2                            : %len(%trim(xmlData)) );
        tst2     // Get a pointer to the URL encoded data.
        tst2     http_url_encoder_getptr( enc
        tst2                            : encoded_data
        tst2                            : encoded_len);
                 rc = http_url_post_xml ( %trim(pAddress)
                                       : encoded_data
                                       : encoded_len
                                       : *null
                                       : %paddr(EndOfElement)
                                       : *null
                                       : HTTP_TIMEOUT
                                       : HTTP_USERAGENT
                                       :
     'application/x-www-form-urlencoded');
        tst2     http_url_encoder_free(enc);
        In debug, the beginning of xmlData looks like:
        <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE
     pnet_imessage_send

     PUBLIC"-//PeopleNet//pnet_imessage_send""[1][10]http://open.peoplene
     tonline
        .com/dtd/pnet_imessage_send.dtd">
        The beginning of encoded_data looks like:

     service=imessage_send&cid=1111&pw=password&xml=%09X%3C%3Fxml+version
     %3D
        %221.0%22+encoding%3D%22ISO-8859-1%22%3F%3E
        Am I correct in expecting it to look like this?

     service=imessage_send&cid=1111&pw=password&xml=%3C%3Fxml+version%3D%
     221
        .0%22+encoding%3D%22ISO-8859-1%22%3F%3E
        Thanks in advance,
        Donnie
     References
        1. [11]http://open.peoplenetonline.com/dtd/pnet_imessage_send.dtd
     -------------- next part --------------
     HTTPAPI Ver 1.24 released 2012-01-23
     OS/400 Ver V6R1M0
     http_persist_open(): entered
     http_long_ParseURL(): entered
     DNS resolver retrans: 2
     DNS resolver retry  : 2
     DNS resolver options: x'00000136'
     DNS default domain: [12]tmwsystems.com
     DNS server found: 10.3.10.21
     DNS server found: 8.8.8.8
     DNS server found: 208.67.222.222
     http_persist_post(): entered
     http_persist_req(POST) entered.
     http_long_ParseURL(): entered
     do_oper(POST): entered
     There are 0 cookies in the cache
     POST /scripts/open.dll? HTTP/1.1
     Host: [13]open.peoplenetonline.com
     User-Agent: http-api/1.24
     Content-Type: application/x-www-form-urlencoded
     Content-Length: 2089
     senddoc(): entered
     service=imessage_send&cid=1111&pw=password&xml=%09X%3C%3Fxml+version
     %3D%221.0%22+encoding%3D%22ISO-8859-1%22%3F%3E%3C!DOCTYPE+pnet_imess
     age_send+PUBLIC%22-%2F%2FPeopleNet%2F%2Fpnet_imessage_send%22%22http
     %3A%2F%[14]2Fopen.peoplenetonline.com%2Fdtd%2Fpnet_imessage_send.dtd
     %22%3E%3Cpnet_imessage_send%3E%3Ccid%3E1111%3C%2Fcid%3E%3Cpw%3Epassw
     ord%3C%2Fpw%3E%3Cvehicle_number%3E1100687%3C%2Fvehicle_number%3E%3Cd
     eliver%3Enow%3C%2Fdeliver%3E%3Cformdata%3E%3Cform_id%3E55316%3C%2Ffo
     rm_id%3E%3Cim_field%3E%3Cquestion_number%3Eq%23MechanicName%3C%2Fque
     stion_number%3E%3Cdata%3E%3Cdata_text%3EMater%3C%2Fdata_text%3E%3C%2
     Fdata%3E%3C%2Fim_field%3E%3Cim_field%3E%3Cquestion_number%3Eq%23Trac
     tor%23%3C%2Fquestion_number%3E%3Cdata%3E%3Cdata_text%3E1100687%3C%2F
     data_text%3E%3C%2Fdata%3E%3C%2Fim_field%3E%3Cim_field%3E%3Cquestion_
     number%3Eq%23Trailer%23%3C%2Fquestion_number%3E%3Cdata%3E%3Cdata_tex
     t%3E1234%3C%2Fdata_text%3E%3C%2Fdata%3E%3C%2Fim_field%3E%3Cim_field%
     3E%3Cquestion_number%3Eq%23MechanicName%3!
      C%2Fquestion_number%3E%3Cdata%3E%3Cdata_multiple-choice%3E%3Cmc_cho
     icenum%3E1%3C%2Fmc_choicenum%3E%3Cmc_choicetext%3EYes%3C%2Fmc_choice
     text%3E%3C%2Fdata_multiplechoice%3E%3C%2Fdata%3E%3C%2Fim_field%3E%3C
     im_field%3E%3Cquestion_number%3Eq%23DriverName%3C%2Fquestion_number%
     3E%3Cdata%3E%3Cdata_text%3ESpeed+McQueen%3C%2Fdata_text%3E%3C%2Fdata
     %3E%3C%2Fim_field%3E%3Cim_field%3E%3Cquestion_number%3Eq%23DefectRep
     orted%3C%2Fquestion_number%3E%3Cdata%3E%3Cdata_text%3ERO%3A000000000
     118%2C+Defect%3ABrake+Connections%3C%2Fdata_text%3E%3C%2Fdata%3E%3C%
     2Fim_field%3E%3Cim_field%3E%3Cquestion_number%3Eq%23DefectResolution
     %3C%2Fquestion_number%3E%3Cdata%3E%3Cdata_text%3EDisassembled+and+re
     placed+seal%3C%2Fdata_text%3E%3C%2Fdata%3E%3C%2Fim_field%3E%3Cim_fie
     ld%3E%3Cquestion_number%3Eq%23MechanicSignature%3C%2Fquestion_number
     %3E%3Cdata%3E%3Cdata_text%3EMater%3C%2Fdata_text%3E%3C%2Fdata%3E%3C%
     2Fim_field%3E%3Cim_field%3E%3Cquestion_number%3Eq%23MechanicDateTime
     %3C%2Fquestion_number%3E%3Cdata%3E%3C!
      data_text%3E07%2F04%2F1776%3C%2Fdata_text%3E%3C%2Fdata%3E%3C%2Fim_f
     ield%3E%3C%2Fformdata%3E%3C%2Fpnet_imessage_sen
     recvresp(): entered
     HTTP/1.1 200 OK
     Date: Sat, 30 Jun 2012 00:09:23 GMT
     Server: Microsoft-IIS/6.0
     Content-Type: text/html
     Content-Length: 358
     SetError() #13: HTTP/1.1 200 OK
     recvresp(): end with 200
     recvdoc parms: identity 358
     header_load_cookies() entered
     recvdoc(): entered
     SetError() #0:
     <?xml version="1.0" encoding="ISO-8859-1"?>
     <!DOCTYPE pnet_response PUBLIC "-//PeopleNet//pnet_response"
     "[15]http://open.peoplenetonline.com/dtd/pnet_response.dtd";>
     <pnet_response><sendresult>failure</sendresult><error_message>XML
     failed to parse. The reported error was: File: . Line: 1 Col: 2
     Error: Expected String: '&lt;'
     </error_message></pnet_response>
     http_close(): entered
     ------------------------------
     Message: 2
     Date: Fri, 29 Jun 2012 22:39:02 -0500
     From: Scott Klement <[16]sk@xxxxxxxxxxxxxxxx>
     To: HTTPAPI and FTPAPI Projects <[17]ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
     Subject: Re: http_url_encoder_addvar()
     Message-ID: <[18]4FEE74D6.8000506@xxxxxxxxxxxxxxxx>
     Content-Type: text/plain; charset=ISO-8859-1; format=flowed
     %09 is the ASCII code for a tab character.   Any chance that you've
     accidentally hit tab when typing in your XML?
     -SK
     On 6/29/2012 8:25 PM, Donnie Sanders wrote:
     >     All,
     >
     >
     >
     >     This is my first attempt at posting data to a HTTP server and
     using
     >     http_url_post_xml.
     >
     >
     >
     >     I believe my problem is that I'm getting an unexpected %09X
     inserted in
     >     my field when using http_url_encoder_addvar().
     >
     >
     >
     >
     >
     >     Here's the related code:
     >
     >
     >
     >     tst2 D enc             s
     like(HTTP_URL_ENCODER)
     >     tst2 D encoded_data    S               *
     >     tst2 D encoded_len     S             10I 0
     >          d xmlData         s          65535a   varying
     >
     >
     >
     >     tst2   // URL encode the data.
     >     tst2     enc = http_url_encoder_new();
     >     tst2     http_url_encoder_addvar_s(enc : 'service' :
     'imessage_send');
     >     tst2     http_url_encoder_addvar_s(enc : 'cid' :
     %trim(pUserID));
     >     tst2     http_url_encoder_addvar_s(enc : 'pw'  :
     %trim(pPassword));
     >
     >     tst2     http_url_encoder_addvar( enc
     >     tst2                            : 'xml'
     >     tst2                            : %addr(xmlData)
     >     tst2                            : %len(%trim(xmlData)) );
     >
     >     tst2     // Get a pointer to the URL encoded data.
     >     tst2     http_url_encoder_getptr( enc
     >     tst2                            : encoded_data
     >     tst2                            : encoded_len);
     >
     >              rc = http_url_post_xml ( %trim(pAddress)
     >                                    : encoded_data
     >                                    : encoded_len
     >                                    : *null
     >                                    : %paddr(EndOfElement)
     >                                    : *null
     >                                    : HTTP_TIMEOUT
     >                                    : HTTP_USERAGENT
     >                                    :
     'application/x-www-form-urlencoded');
     >
     >     tst2     http_url_encoder_free(enc);
     >
     >
     >
     >     In debug, the beginning of xmlData looks like:
     >
     >
     >
     >     <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE
     pnet_imessage_send
     >
     PUBLIC"-//PeopleNet//pnet_imessage_send""[1][19]http://open.peoplene
     tonline
     >     .com/dtd/pnet_imessage_send.dtd">
     >
     >
     >
     >     The beginning of encoded_data looks like:
     >
     >
     >
     >
     service=imessage_send&cid=1111&pw=password&xml=%09X%3C%3Fxml+version
     %3D
     >     %221.0%22+encoding%3D%22ISO-8859-1%22%3F%3E
     >
     >
     >
     >     Am I correct in expecting it to look like this?
     >
     >
     >
     >
     service=imessage_send&cid=1111&pw=password&xml=%3C%3Fxml+version%3D%
     221
     >     .0%22+encoding%3D%22ISO-8859-1%22%3F%3E
     >
     >
     >
     >     Thanks in advance,
     >
     >     Donnie
     >
     > References
     >
     >     1.
     [20]http://open.peoplenetonline.com/dtd/pnet_imessage_send.dtd
     >
     >
     >
     >
     --------------------------------------------------------------------
     ---
     > This is the FTPAPI mailing list.  To unsubscribe, please go to:
     > [21]http://www.scottklement.com/mailman/listinfo/ftpapi
     >
     --------------------------------------------------------------------
     ---
     ------------------------------
     --------------------------------------------------------------------
     ---
     This is the FTPAPI mailing list digest.  To unsubscribe, go to:
     [22]http://www.scottklement.com/mailman/listinfo/ftpapi
     --------------------------------------------------------------------
     ---
     End of Ftpapi Digest, Vol 72, Issue 22
     **************************************

References

   1. mailto:ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
   2. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   3. http://scottklement.com/mailman/listinfo/ftpapi
   4. mailto:ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
   5. mailto:ftpapi-owner@xxxxxxxxxxxxxxxxxxxxxx
   6. mailto:i5pgmranalyst@xxxxxxxxx
   7. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   8. mailto:hzCWXwaJLvyUHJzGeqUfxxdk%2BQ76kWNZGwj24KJeDnhqc8A@xxxxxxxxxxxxxx
   9. http://open.peoplenetonline.com/dtd/pnet_imessage_send.dtd
  10. http://open.peoplenetonline/
  11. http://open.peoplenetonline.com/dtd/pnet_imessage_send.dtd
  12. http://tmwsystems.com/
  13. http://open.peoplenetonline.com/
  14. http://2Fopen.peoplenetonline.com/
  15. http://open.peoplenetonline.com/dtd/pnet_response.dtd
  16. mailto:sk@xxxxxxxxxxxxxxxx
  17. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
  18. mailto:4FEE74D6.8000506@xxxxxxxxxxxxxxxx
  19. http://open.peoplenetonline/
  20. http://open.peoplenetonline.com/dtd/pnet_imessage_send.dtd
  21. http://www.scottklement.com/mailman/listinfo/ftpapi
  22. 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
-----------------------------------------------------------------------