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

RE: New to XML - Dequeue2 Request Issue



Nothing stands out to me...you never explained how and where "I'm having an issue". 

Post debug. Make sure to scrub proprietary or confidential information.

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of corby.weaver@xxxxxxxxxxxxxxxxx
Sent: Wednesday, December 2, 2015 10:50 AM
To: HTTPAPI and FTPAPI Projects
Subject: RE: New to XML - Dequeue2 Request Issue

   I've got my initial file coming in fine (Step 1).  I'm having an issue
   with Step 2, parsing the "real" data.
   Here is my code:
       soapfile = '/tmp/OmniTracsFuelRaw.soap';



       rc = http_url_post(



         'https://services.omnitracs.com:443/otsWebWS/services/OTSWebSvcs'

                       : %addr(SOAP) + 2

                       : %len(SOAP)

                       : soapfile

                       : HTTP_TIMEOUT

                       : HTTP_USERAGENT

                       : 'text/xml'

                       : 'ETS Test');



     if (rc <> 1);

        unlink(soapfile);
        http_crash();
     endif;

     // ----------------------------------------------
     //   The response from the server will be in
     //   the IFS in a file with a unique name.
     //   that IFS filename is in the "tempfile"
     //   variable at this point.
     //
     //   For debugging purposes, display the
     //   contents of that file, now.
     // ----------------------------------------------
      // ----------------------------------------------
      //  Parse the SOAP document (the one in soapfile)
      //  Inside it will be another XML document that's
      //  embedded within -- save that to a separate
      //  file in the IFS.
      // ----------------------------------------------

        embfile = '/tmp/OmniTracsFuelFin.soap';

        if (http_parse_xml_stmf( soapfile
                               : HTTP_XML_CALC
                               : *null
                               : %paddr(SaveEmbed)
                               : %addr(embfile) ) < 0);
            callp close(fd);
            unlink(soapfile);
            unlink(embfile);
            http_crash();
        endif;

        unlink(soapfile);

   Anything stand out?  Thoughts and suggestions are appreciated.
   Thanks!
   Corby Weaver
   From:        Mike Krebs <mkrebs@xxxxxxxxxxxxxxxxxx>
   To:        HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>,
   Date:        11/20/2015 05:09 PM
   Subject:        RE: New to XML - Dequeue2 Request Issue
   Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
     __________________________________________________________________

   Let's break the project into steps:
   1. Send request and receive response
   2. Parse the IFS file saving the "real" data
   3. Decode the "real" data
   4. Parse the "real" data
   See Example17 for 1, 2, and 4. To decode see Scott's Base64 or the
   built-in support in OS400.
   Alternatively, use WSDL2RPG as in the linked thread to do what you
   need. It is a little harder to understand initially but it will
   generate programs for you to modify for the service. Depending on the
   WSDL, it might do everything you need.
   -----Original Message-----
   From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   [[1]mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
   corby.weaver@xxxxxxxxxxxxxxxxx
   Sent: Friday, November 20, 2015 1:05 PM
   To: HTTPAPI and FTPAPI Projects
   Subject: Re: New to XML - Dequeue2 Request Issue
     Sorry, it is encoded, not encrypted.  There was a similar post a few
     years ago where the transaction portion of the XML document was
   parsed
     and I assume the base64 decoder worked.  Being unfamiliar with XML, I
     do not know what the code should be for my specific program.
     Here is a link to the previous thread...
     [1][2]https://scottklement.com/archives/ftpapi/201210/msg00121.html
     I'm hoping someone is able to help me with the portion of code that
     does the parse.
     Thanks,
     Corby Weaver
   References
     1. [3]https://scottklement.com/archives/ftpapi/201210/msg00121.html
   -----------------------------------------------------------------------
   This is the FTPAPI mailing list.  To unsubscribe, please go to:
   [4]http://www.scottklement.com/mailman/listinfo/ftpapi
   -----------------------------------------------------------------------
   -----------------------------------------------------------------------
   This is the FTPAPI mailing list.  To unsubscribe, please go to:
   [5]http://www.scottklement.com/mailman/listinfo/ftpapi
   -----------------------------------------------------------------------

References

   1. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   2. https://scottklement.com/archives/ftpapi/201210/msg00121.html
   3. https://scottklement.com/archives/ftpapi/201210/msg00121.html
   4. http://www.scottklement.com/mailman/listinfo/ftpapi
   5. 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
-----------------------------------------------------------------------