I am getting a 500 error "Cannon read script output pipe" when trying to
write out my user space through QtmhWrStout. I am so confused here and
Google isn't helping me (I am sure I am not using the right terminology).
     D QtmhWrStout     PR                  extproc('QtmhWrStout')
     D   DtaVar                   32767A   options(*varsize) const
     D   DtaVarLen                   10I 0 const
     D   ErrorCode                 8000A   options(*varsize)
     D QtmhWrStoutPtr  PR                  extproc('QtmhWrStout')
     D   DtaVar                        *   value
     D   DtaVarLen                   10I 0 const
     D   ErrorCode                 8000A   options(*varsize)
     P*----------------------------
----------------------
     P* Procedure name: Main
     P* Purpose:
     P* Returns:
     P*--------------------------------------------------
     P Main            B
     D Main            PI
      /free
       //  Read all of the data sent via STDIN into the user space.
       QtmhRdStin( p_UsrSpcData
                 : MAXSPACE
                 : len
                 : Kaboom );
       // Do stuff here
       WriteResponse('Content-Type: application/xml' + cr);
       WriteResponse('Content-Length: ' + %char(%len(p_UsrSpcData)));
       QtmhWrStoutPtr(p_UsrSpcData:%len(p_UsrSpcData):ErrCode);
       return;
      /end-free
     P Main            E
     P*--------------------------------------------------
     P* Procedure name: WriteResponse
     P* Purpose:
     P* Returns:
     P*--------------------------------------------------
     P WriteResponse   B
     D WriteResponse   PI
     D  buffer                    32767A   options(*varsize) const
      /free
       QtmhWrStout(%trim(buffer):%len(%trim(buffer)):ErrCode);
       return;
      /end-free
     P WriteResponse   E
Right now I am just trying to bring in an XML document and write it back
out. Just to make sure my code is working.
What am I doing stupid?
--
Mike Wills
http://mikewills.info
P: (507) 933-0880 | Skype: koldark
As an Amazon Associate we earn from qualifying purchases.