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

RE: Ftpapi Digest, Vol 44, Issue 3



Thank you for the help!

I have now successfully sent information to my HTTPS server which my web guy was able to see, using http_url_post.
I still have to test having him send something back... He was just dumping out whatever I sent.
I believe I have to have him send XML data to /tmp/httptest.html... Or whatever's in the 4th parameter of http_url_post?

I'm still not sure why the http_url_post_xml didn't work, but the http_url_post worked.
I discovered (using http_redir_loc) that, without the "/" the 302 "redirect" was just adding the "/" to the end.
But when I actually used the "/" at the end I was getting the XML parse error.

I have a question on a separate subject, I'm actually going to have to subscribe to another list,
Just wondered which list is the right list... Where do I post questions about OpenSSH and SFTP?

Thanks,
Charlie
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
Sent: Wednesday, February 03, 2010 1:00 PM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Ftpapi Digest, Vol 44, Issue 3

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: Ftpapi Digest, Vol 44, Issue 1 (Mike Krebs)
   2. help (alberto.reali@xxxxxxxxxxxxx)


----------------------------------------------------------------------

Message: 1
Date: Tue, 2 Feb 2010 12:20:57 -0600
From: Mike Krebs <mkrebs@xxxxxxxxxxxxxxxxxx>
Subject: RE: Ftpapi Digest, Vol 44, Issue 1
To: HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Message-ID: <3DF08BA25872B644A1421B9F085B18290151513863@xxxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"

Debug logs are generated when you turn them on.

(from example1)
*********************************************************
 *  Turning on debugging.
 *
 *     Calling http_debug and passing *ON will turn on
 *     HTTPAPI's debugging support.  It will write a debug
 *     log file to the IFS in /tmp/httpapi_debug.txt
 *     with loads of tech info about the HTTP transaction.
 *
 *     The debug file is crucial if you have problems!
 *********************************************************
c                   callp     http_debug(*ON)

After you call your program, look in /tmp/httpapi_debug.txt and you will see most of the "conversation" that goes on behind the scenes.

As far as slash or no slash, it depends on if you know what you want to get. In this case, it sounds like there should be a web service running on the server and you should be making a direct call to the web service (most likely no slash). However, if you want to retrieve whatever is at http://abc.com/products/ then include the slash. The web server will serve up the standard page from that directory (most likely index.html). If upon examination of the index.html page, you decide to pull up producta information, then it would be appropriate to make the call to http://abc.com/products/producta.html (no slash - direct retrieval of page).

302 is a redirection "error". Example4 shows one way to deal with 302.

Mike Krebs


> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-
> bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Versfelt, Charles
> Sent: Tuesday, February 02, 2010 10:02 AM
> To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: Ftpapi Digest, Vol 44, Issue 1
>
>
> Hi,
>
> I'm still working on doing my first attempt to send to an HTTPS server
> using HTTPAPI.
> I'm using a slightly modified version of Example 16.
> I actually made some progress and got a little further..  I'm not sure
> how to do a debug log of the HTTPAPI itself.
> I've been walking through the RPG in regular debug.
>
> First, I got this message: (GSKit) Access to the key database is not
> allowed.
> Problem solved:  I found the solution in the archives, an authority
> issue which I had our Operations manager fix.
>
> Then, I got this message:  (GSKit) Handle is not valid.
> I did a reclaim activation group to solve that.
> Question:  When I write my 'real' application, will I have to reclaim
> activation group before every call?
>
> Now that I got through those issues, I made it to this:
>
> I tried structuring my link two different ways, with and without a
> trailing "/"
>
> Here's my command, I just changed the "xxx" part.
>
> rc = http_url_post_xml('https://beta.xxx.com/cf/as400'
>                       : %addr(postData) + 2
>                       : %len(postData)
>                       : %paddr(StartOfElement)
>                       : %paddr(EndOfElement)
>                       : *NULL );
>
> Alternate, with the trailing /:
>
> rc = http_url_post_xml('https://beta.xxx.com/cf/as400/'
>
> 1.  When I do the first version (without the trailing "/") I get error
> 302
>
> Error:  HTTP/1.1 302 Moved Temporarily
>
> 2. When I do the second version (with the trailing "/") I get -1
>
> Error:  XML parse failed at line 2, col 0: no element found
>
> Thanks,
> Charlie
>
> >Please tell us what the error message is.  The -1 by itself just means
> >"something went wrong".   Your program then needs to call http_error()
> >o determine WHAT went wrong.
>
> >Or even better yet, create a debug log that shows everything that
> HTTPAPI is going through, and where it's getting the error.
>
> >Please also move this conversation to the FTPAPI mailing list (which
> is the proper place to discuss both the HTTPAPI and
> >FTPAPI projects) rather than on Midrange.com
>
>
> On 2/1/2010 2:58 PM, Versfelt, Charles wrote:
> >
> > Hi again,
> >
> > Please forgive me for my "beginner" questions, it's frustrating that
> > no one at my company knows the socket/HTTPS/HTTPAPI And I have to
> learn it on the fly...
> >
> > My web guy, of course, doesn't know RPG or iSeries or HTTPAPI... He
> only knows the web.
> >
> > When I asked on here about sending nonsense, you (Scott) gave the
> analogy of calling an operator and saying "bibbity bobbity."
> >
> > I'm suspecting from that answer, that what my web guy asked me to do
> on the outset of this project... Makes no sense.
> > That my request has been "bibbity bobbity" and that's why I'm trying
> to do "bibbity bobbity."
> >
> > Here's the situation:  The actual project, we will have an https
> > site
> to send and receive payment data, is not yet ready.
> > That is, I'm still waiting for people in the management end for the
> "outside" site I'm ultimately going to send and receive data.
> >
> > In the meantime, I've been asked as a "proof of concept" to prove
> that
> > I can send something, anything, from an RPG program on the iSeries
> > to
> an https site.
> >
> > My company has its own https site, as well as a beta development
> https site, which is used for other purposes.
> >
> > Our web guy told me, just send anything to that site.  He set up a
> folder on the site, he gave me a URL, in the form of
> "https://xxx.abc/def/ghi";) and said, "Send me something there,
> anything."
> >
> > I said, "I was told it has to be valid XML instructions," I even
> > gave
> the analogy of the "bibbity bobbity."
> > He said, "Sure, send me any XML, I don't care what it is.  Drop it
> into this folder and I'll see if I can open and look at it."
> > I described the sample program with the UPS tracking#, he said just
> to send that, whatever the UPS site gets in the sample program.  He
> seems to think that I can send anything and it will show up in his
> folder as something he can read.
> >
> > Correct me if I'm wrong..... What he's asking for doesn't make any
> sense, does it?
> > I can't just send him anything... Can I?
> >
> > Doesn't the https site itself have to have some web programming on
> his end (analogy:  "the operator") that is looking for specific type
> of intructions (XML in the format expected by the site, in the
> analogy, speak the language the operator understands, as for example,
> a UPS site has some sort of web programming that expects to
> see<AccessRequest> and then, inside that,<AccessLicenseNumber>  and
> etc.) and if the
> https: site doesn't have some sort of web program expecting to see
> those commands, then it's like a telephone with no operator and it all
> becomes gobbeldy gook?
> >
> > He seems very sure that I should be able to just get a connection
> from my AS400 by plugging in the URL and then drop anything into his
> folder, and he can read it.
> >
> > I tried taking the EXAMPLE programs (5 and 12)  and changing the UPS
> URLs to the URL the web guy gave me, and then just run them exactly as
> is.
> >
> > They come back with rc = -1.  My web guy sees nothing.
> >
> > Am I getting -1 because I really need to hit an https site that is
> expecting something meaningful to it, that the https: site has to have
> something waiting for specific XML commands?
> >
> > Charlie
> >
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -


------------------------------

Message: 2
Date: Wed, 3 Feb 2010 10:40:33 +0100
From: <alberto.reali@xxxxxxxxxxxxx>
Subject: help
To: <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Message-ID:
        <C01DF5D5483F7744A00E6EDC3671E101C5B52B99C6@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>

Content-Type: text/plain; charset="us-ascii"

Hi,
I'm trying tu use a simple SOAP to inzitialize me to Scott's HTTP tool.
This is my invoke SOAP

SOAP =
'<?xml version="1.0" encoding="utf-8"?>'
+'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";'
+' xmlns:xsd="http://www.w3.org/2001/XMLSchema";'
+' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>'
+'<soap:Body>'
+'<GetRating xmlns="http://tempuri.org/"; />'
+'</soap:Body>'
+'</soap:Envelope>';

The simple webservice result is the string "AAA" but I can't read it. My http_url_post_xml call did not response with error (rc = 1) but I didn't read string "AAA".

This is my simple code, can you help me?

D Incoming        PR
D   String                   32767A   varying
D   depth                       10I 0 value
D   name                      1024A   varying const
D   path                     24576A   varying const
D   value                    65535A   varying const
D   attrs                         *   dim(32767)
D                                     const options(*varsize)

D SOAP            s           2000A   varying
D rc              s             10I 0
D String          s           1000A   varying
D Lang            s             32A
D LangMode        s             41A   varying
/free

 SOAP =
 '<?xml version="1.0" encoding="utf-8"?>'
 +'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";'
 +' xmlns:xsd="http://www.w3.org/2001/XMLSchema";'
 +' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>'
 +'<soap:Body>'
 +'<GetRating xmlns="http://tempuri.org/"; />'
 +'</soap:Body>'
 +'</soap:Envelope>';

 HTTP_setCCSIDs(1208: 0);  // CCSID 1208 = UTF-8

 rc = http_url_post_xml(
          'http://10.178.49.9/wsfers/wsrating.asmx'
                   : %addr(SOAP) + 2
                   : %len(SOAP)
                   : *NULL
                   : %paddr(Incoming)
                   : %addr(String)
                   : HTTP_TIMEOUT
                   : HTTP_USERAGENT
                   : 'text/xml;'
                     : 'http://tempuri.org/GetRating');
   if (rc <> 1);
      http_crash();
   else;
      http_comp(String);
   endif;

   *inlr = *on;

  /end-free

 P Incoming        B
 D Incoming        PI
 D   String                   32767A   varying
 D   depth                       10I 0 value
 D   name                      1024A   varying const
 D   path                     24576A   varying const
 D   value                    65535A   varying const
 D   attrs                         *   dim(32767)
 D                                     const options(*varsize)

  /free
      if (name = 'TranslateResult');
         String = value;
     endif;
 /end-free
P                 E

    THANKS FOR ALL THE HELPER

Alberto



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.
-------------- next part --------------

   Hi,

   I'm trying tu use a simple SOAP to inzitialize me to Scott's HTTP
   tool.

   This is my invoke SOAP


   SOAP =

   '<?xml version="1.0" encoding="utf-8"?>'

   +'<soap:Envelope
   xmlns:xsi="[1]http://www.w3.org/2001/XMLSchema-instance";'

   +'
   xmlns:xsd="[2]http://www.w3.org/2001/XMLSchema";'

   +'
   xmlns:soap="[3]http://schemas.xmlsoap.org/soap/envelope/";>'

   +'<soap:Body>'

   +'<GetRating xmlns="[4]http://tempuri.org/";
   />'

   +'</soap:Body>'

   +'</soap:Envelope>';


   The simple webservice result is the string "AAA" but I can't read it.
   My http_url_post_xml call did not response with error (rc = 1) but I
   didn't read string "AAA".


   This is my simple code, can you help me?


   D Incoming        PR

   D   String                   32767A   varying

   D   depth                       10I 0 value

   D   name                      1024A   varying const

   D   path                     24576A   varying const

   D   value                    65535A   varying const

   D   attrs                         *   dim(32767)

   D                                     const options(*varsize)


   D SOAP            s           2000A   varying

   D rc              s             10I 0

   D String          s           1000A   varying

   D Lang            s             32A

   D LangMode        s             41A   varying

   /free



    SOAP
   =

    '<?xml version="1.0"
   encoding="utf-8"?>'

    +'<soap:Envelope
   xmlns:xsi="[5]http://www.w3.org/2001/XMLSchema-instance";'

    +'
   xmlns:xsd="[6]http://www.w3.org/2001/XMLSchema";'

    +'
   xmlns:soap="[7]http://schemas.xmlsoap.org/soap/envelope/";>'

    +'<soap:Body>'

    +'<GetRating xmlns="[8]http://tempuri.org/"; />'

    +'</soap:Body>'

    +'</soap:Envelope>';



    HTTP_setCCSIDs(1208: 0);  // CCSID 1208 =
   UTF-8



    rc =
   http_url_post_xml(

             'http://10.178.49.9/wsfers/wsrating.asmx'

                      : %addr(SOAP) +
   2

                      :
   %len(SOAP)

                      :
   *NULL

                      :
   %paddr(Incoming)

                      :
   %addr(String)

                      :
   HTTP_TIMEOUT

                      : HTTP_USERAGENT

                      :
   'text/xml;'

                        : 'http://tempuri.org/GetRating');

      if (rc <> 1);

         http_crash();

      else;

         http_comp(String);

      endif;


      *inlr = *on;


     /end-free


    P Incoming        B

    D Incoming        PI

    D   String                   32767A   varying

    D   depth                       10I 0 value

    D   name                      1024A   varying const

    D   path                     24576A   varying const

    D   value                    65535A   varying const

    D   attrs                         *   dim(32767)

    D                                     const options(*varsize)


     /free

         if (name = 'TranslateResult');

            String = value;

        endif;

    /end-free

   P                 E


       THANKS FOR ALL THE HELPER


   Alberto


   This message is for the designated recipient only and may contain
   privileged, proprietary, or otherwise private information. If you have
   received it in error, please notify the sender immediately and delete
   the original. Any other use of the email by you is prohibited.

References

   1. http://www.w3.org/2001/XMLSchema-instance
   2. http://www.w3.org/2001/XMLSchema
   3. http://schemas.xmlsoap.org/soap/envelope/
   4. http://tempuri.org/
   5. http://www.w3.org/2001/XMLSchema-instance
   6. http://www.w3.org/2001/XMLSchema
   7. http://schemas.xmlsoap.org/soap/envelope/
   8. http://tempuri.org/

------------------------------

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


End of Ftpapi Digest, Vol 44, Issue 3
*************************************
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------