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

RE: http_parse_xml_stmf error open(): No such path or directory



Hi Scott, 

I've attached a pared-down version of the program, which gives the same error. The extra assignment to the filename variable before the call was just a test. The prd version does not have this, but the effect is the same. Please also see the attached log .

So In the prd version I'm double-dipping the xml, since it contains CDATA . The first hit  receives xml and parses out the contents from a CDATA tag into my stmf, then feeding that back in to the http_parse_xml_stmf command. This all happens in one program. Until now, it's been fine. 

This test program is simply accepting input from a file I created in /tmp/... just to debug it. If I replace 'filename' in the call, with a literal, it works.


Thanks,


David
      *
      *  To Compile (requires V5R1):
      *   CRTBNDRPG PGM(DHGEN/tststmf) SRCFILE(DHGEN/QRPGLESRC) dbgview(*source)
      *
      *  To Run:
      *     CALL tststmf  PARM('XXX')
      *
      *
     H DFTACTGRP(*NO) ACTGRP(*NEW)  BNDDIR('HTTPAPI':'QC2LE')


      /copy httpapi_h

     D tststmf         PR                  ExtPgm('tststmf')
     D   embfile                     50A   varying
     D tststmf         PI
     D   embfile                     50A   varying
       //                                                                  //
       // ---------------------------- PROTOTYPES -------------------------//
       //                                START                             //

       //  Handler when start of element found
     D st_embedded     PR
     D   userdata                      *   value
     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)

       //  Handler when end of element found
     D end_embedded    PR
     D   userdata                      *   value
     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)


       //                                                                   //
       // ----------------------------- PROTOTYPES -------------------------//
       //                                  END                              //

       //                                                                   //
       // ----------------------------  VARIABLES  -------------------------//
       //                                 START                             //

     D rtncde          s              7A
     D filename        s             50A   varying

       //                                                                   //
       // ----------------------------  MAIN ROUTINE -----------------------//
       //                                 START                             //

      /free

       http_debug(*ON:'/tmp/log_tststmf.txt');
       http_XmlStripCRLF(*ON);
       http_XmlReturnPtr(*OFF);

       filename=%trimr(embfile);
       // Parse the embedded xml in the temporary file
       if (http_parse_xml_stmf( %trimr(filename)
                              : HTTP_XML_CALC
                              : %paddr(st_embedded)
                              : %paddr(end_embedded)
                              : *null ) < 0);
        //unlink(embfile);
          http_crash();
       endif;

       // Delete the temporary file
       // unlink(embfile);

       *inlr = *on;
       return;

      /end-free
       //                                                                   //
       // ----------------------------  MAIN ROUTINE -----------------------//
       //                                  END                              //


     P st_embedded     B
     D st_embedded     PI
     D   userdata                      *   value
     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
           rtncde= '';
      /end-free
     P                 E


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

      /free
           rtncde = '';
      /end-free
     P                 E

HTTPAPI Ver 1.24 released 2012-01-23
OS/400 Ver V7R1M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
SetError() #22: open(): No such path or directory.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------