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

Re: AW: question about example 2



Are you running an old version of HTTPAPI?

On 3/24/2015 7:30 PM, Larry Kleinman wrote:
    Scott - I got it to work.  I added the parms that you suggested but got
    a "pointer not set for location referenced" message.   Then I change
    the 7th parm from *OMIT to HTTP_USERAGENT (like in EXAMPLE2) and it
    worked.  I don't know why, but I bet you do.   When you get a chance,
    can you explain?
    Thanks
    and thank you, Mike, for your help as well!
    Larry Kleinman
    Kleinman Associates, Inc.
    212-949-6469
    From:        Scott Klement <sk@xxxxxxxxxxxxxxxx>
    To:        HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>,
    Date:        03/24/2015 07:16 PM
    Subject:        Re: AW: question about example 2
    Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
      __________________________________________________________________

    Larry,
    You aren't providing the content-type.  Most installations have the
    default for content-type set to XML since that's the most common use of
    HTTPAPI...   But, since you are simulating an HTML form, the
    content-type should be application/x-www-form-urlencoded (this is off
    the top of my head, hopefully I'm remembering it right.)   PHP may be
    ignoring your data because you're telling it that the data is XML and
    it
    doesn't understand that type of data??  The content-type can be passed
    in the 8th parameter to http_url_post_raw().
    You are coding in fixed format calcs (shudder), so I guess you'd want
    to
    code it like this (keeping the rest of the code the way you had it in
    the SEU printout you provided...)
            c                   eval      rc = http_url_post_raw(
            c 'http://192.168.98.3/mitchells' +
            c                              '/CreateCreditTest.php':
            c                             : mypointer
            C                             : dataSize
            c                             : 1
            C                             : %paddr('INCOMING')
            C                             : HTTP_TIMEOUT
            C                             : *OMIT
            C                             :
    'application/x-www-form-urlencoded' )
    Does that help?  If not, we'll need a debug file like Mike said... but
    we could skip that step if that's all the issue is.
    -SK
    On 3/24/2015 1:33 PM, Larry Kleinman wrote:
    >     Mike - I'm getting lost.  I think I did what you suggested, but
    no data
    >     is POSTing to the PHP script.   I've acttached the code that I'm
    using.
    >       Do you see what I'm doing wrong?
    >     Larry Kleinman
    >     Kleinman Associates, Inc.
    >     212-949-6469
    >     From:        Mike Krebs <mkrebs@xxxxxxxxxxxxxxxxxx>
    >     To:        HTTPAPI and FTPAPI Projects
    <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>,
    >     Date:        03/24/2015 12:22 PM
    >     Subject:        RE: AW: question about example 2
    >     Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    >
    __________________________________________________________________
    >
    >     So, that is pretty straight forward. Just substitute your
    variables
    >     (RequestID, Reference, etc) for the from, subject and Comment in
    >     EXAMPLE2.
    >     You will have myPointer to the webform data when you are
    finished. Send
    >     that to http_url_post_raw in place of %addr(data). Send dataSize
    in
    >     place of %len(%trimr(data)). The rest you can use EXAMPLE5 for.
    >     -----Original Message-----
    >     From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    >     [[1][1]mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
    Larry
    >     Kleinman
    >     Sent: Tuesday, March 24, 2015 10:57 AM
    >     To: HTTPAPI and FTPAPI Projects
    >     Subject: RE: AW: question about example 2
    >     The URL is a private one, which you will not be able to access.
    It is
    >     only a PHP script with lines like
    >     $RequestID = $_POST["RequestID"]
    >     $Reference = $_POST["Reference"]
    >     so I want the RPG program to POST a value for RequestD and for
    >     Reference
    >     The script also does some simple ECHOs, and I want to get that
    back in
    >     retdata
    >     Larry Kleinman
    >     Kleinman Associates, Inc.
    >     212-949-6469
    >     From:   Mike Krebs <mkrebs@xxxxxxxxxxxxxxxxxx>
    >     To:     HTTPAPI and FTPAPI Projects
    <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>,
    >     Date:   03/24/2015 11:42 AM
    >     Subject:        RE: AW: question about example 2
    >     Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    >     Did you send us the url you are trying to post to? Using the
    webForm
    >     stuff
    >     it is pretty easy to create the right variable but reading the
    html and
    >     getting them right is not always easy. A URL would make it easier
    to
    >     help
    >     you.
    >     -----Original Message-----
    >     From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [
    >     [2][2]mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
    Larry
    >     Kleinman
    >     Sent: Tuesday, March 24, 2015 9:58 AM
    >     To: HTTPAPI and FTPAPI Projects
    >     Subject: Re: AW: question about example 2
    >     Hi Thomas - I've attached the source for EXAMPLE5.
    >     I can't figure out how to use it to POST data to the web form,
    and I
    >     suspect that it involves using some of the code in EXAMPLE2,
    which I've
    >     also attached.   I guess I am trying to combine the two of them
    into
    >     something which will POST several fields to a web form (like
    EXAMPLE 2
    >     does with fromAddr, subject, and message) , and put what was
    returned
    >     by
    >     the web site into data that I can manipulate (like EXAMPLE 5 foes
    with
    >     retdata)
    >     Larry Kleinman
    >     Kleinman Associates, Inc.
    >     212-949-6469
    >     From:   Thomas Raddatz <thomas.raddatz@xxxxxx>
    >     To:     "'HTTPAPI and FTPAPI Projects'"
    >     <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>,
    >     Date:   03/24/2015 08:46 AM
    >     Subject:        AW: question about example 2
    >     Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    >     Larry,
    >     It was great if you could send the source to me, since I do not
    have an
    >     archive of 1.23. The oldest archive I have is 1.25.
    >     Thomas.
    >     -----Ursprüngliche Nachricht-----
    >     Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [
    >     [3][3]mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag
    von Larry
    >     Kleinman
    >     Gesendet: Dienstag, 24. März 2015 13:28
    >     An: HTTPAPI and FTPAPI Projects
    >     Cc: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    >     Betreff: Re: question about example 2
    >     Yep, I am using the same version.   Thomas, do you need me to
    send you
    >     the
    >     source, or can you find it in an archive of version 1.23
    >     Larry Kleinman
    >     Kleinman Associates, Inc.
    >     212-949-6469
    >     From:   Thomas Bishop <tbishop2@xxxxxxxxxx>
    >     To:     "ftpapi@xxxxxxxxxxxxxxxxxxxxxx"
    >     <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>,
    >     Date:   03/24/2015 08:08 AM
    >     Subject:        Re: question about example 2
    >     Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    >     My copy of EXAMPLE5 also uses "raw".  Version 1.23
    >     Comment at top of EXAMPLE5 source code states:
    >     * This performs the same example as EXAMPLE4, except that it
    >     * uses the "raw" versio of http_url_post(). The advantage is
    >     * that data is received directly into a variable in the program
    >     * instead of writing it to the IFS.
    >     Source code contains the following:
    >     c                   eval      rc=http_url_post_raw(
    >     c                             'https://wwwcie.ups.com/ups.app' +
    >     c                             '/xml/Track':
    >     c                              %addr(data): %len(%trimr(data)):
    >     c                              1: %paddr('INCOMING'))
    >     c                   if        rc <> 1
    >     c                   eval      msg = http_error
    >     c                   dsply                   msg
    >     c                   return
    >     c                   endif
    >     The information transmitted is intended only for the person or
    entity
    >     to
    >     which it is addressed and may contain CONFIDENTIAL material.  If
    you
    >     receive this material/information in error, please contact the
    sender
    >     and
    >     delete or destroy the material/information.
    >
    -----------------------------------------------------------------------
    >     This is the FTPAPI mailing list.  To unsubscribe, please go to:
    >     [4][4]http://www.scottklement.com/mailman/listinfo/ftpapi
    >
    -----------------------------------------------------------------------
    >     --
    >     IMPORTANT NOTICE:
    >     This email is confidential, may be legally privileged, and is for
    the
    >     intended recipient only. Access, disclosure, copying,
    distribution, or
    >     reliance on any of it by anyone else is prohibited and may be a
    >     criminal
    >     offence. Please delete if obtained in error and email
    confirmation to
    >     the
    >     sender.
    >
    -----------------------------------------------------------------------
    >     This is the FTPAPI mailing list.  To unsubscribe, please go to:
    >     [5][5]http://www.scottklement.com/mailman/listinfo/ftpapi
    >
    -----------------------------------------------------------------------
    >
    -----------------------------------------------------------------------
    >     This is the FTPAPI mailing list.  To unsubscribe, please go to:
    >     [6][6]http://www.scottklement.com/mailman/listinfo/ftpapi
    >
    -----------------------------------------------------------------------
    >
    -----------------------------------------------------------------------
    >     This is the FTPAPI mailing list.  To unsubscribe, please go to:
    >     [7][7]http://www.scottklement.com/mailman/listinfo/ftpapi
    >
    -----------------------------------------------------------------------
    >
    > References
    >
    >     1. [8]mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    >     2. [9]mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    >     3. [10]mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    >     4. [11]http://www.scottklement.com/mailman/listinfo/ftpapi
    >     5. [12]http://www.scottklement.com/mailman/listinfo/ftpapi
    >     6. [13]http://www.scottklement.com/mailman/listinfo/ftpapi
    >     7. [14]http://www.scottklement.com/mailman/listinfo/ftpapi
    >
    >
    >
    >
    -----------------------------------------------------------------------
    > This is the FTPAPI mailing list.  To unsubscribe, please go to:
    > [15]http://www.scottklement.com/mailman/listinfo/ftpapi
    >
    -----------------------------------------------------------------------
    -----------------------------------------------------------------------
    This is the FTPAPI mailing list.  To unsubscribe, please go to:
    [16]http://www.scottklement.com/mailman/listinfo/ftpapi
    -----------------------------------------------------------------------

References

    1. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    2. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    4. http://www.scottklement.com/mailman/listinfo/ftpapi
    5. http://www.scottklement.com/mailman/listinfo/ftpapi
    6. http://www.scottklement.com/mailman/listinfo/ftpapi
    7. http://www.scottklement.com/mailman/listinfo/ftpapi
    8. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
    9. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   10. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   11. http://www.scottklement.com/mailman/listinfo/ftpapi
   12. http://www.scottklement.com/mailman/listinfo/ftpapi
   13. http://www.scottklement.com/mailman/listinfo/ftpapi
   14. http://www.scottklement.com/mailman/listinfo/ftpapi
   15. http://www.scottklement.com/mailman/listinfo/ftpapi
   16. 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
-----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------