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

Re: Help with using QtmhGetEnv



Darryl,

As your question does not appear to be related to HTTPAPI or FTPAPI, I 
recommend using a different list than this one.  This one is purely for 
FTPAPI/HTTPAPI.

The problem appears to be that you didn't bind to the QZHBCGI service 
program in the QHTTPSVR library.  The QtmhGetEnv API is part of the HTTP 
server, and therefore requires the HTTP server to be installed, and 
bound to your program.  (Just like other CGI APIs)

Having said that, all QtmhGetEnv does is access the operating system's 
environment variable support.  If you call the OSes getenv() API, then 
you can read envvars without going through the clunky QZHBCGI service 
program.   Since getenv is a system API, no special binding would be 
required to call it.

But, again, this question doesn't appear to be related to 
FTPAPI/HTTPAPI. Please use a different forum, such as:
http://www.midrange.com
http://www.iprodeveloper.com/forums

Or, if this is related to CGIDEV2, you might try Giovanni's mailing list 
known as Easy400Group

-SK



On 6/13/2012 1:42 PM, Darryl Freinkel wrote:
>     I am writing my first program calling this procedure directly. It is
>     part of a simple CGI program I am developing.
>
>
>          d CGI_GetEnv      PR                  extproc('QtmhGetEnv')
>
>           /copy a4g10xsfs/qxscpy,CGI_GetEnv
>
>          d a4g_GetEnv      PI         32767a   varying
>
>           /copy a4g10xsfs/qxscpy,a4gGetEnv
>
>           *------------------------------------------------
>
>           * Local Variables
>
>           *------------------------------------------------
>
>          d wCGI_EnvVal     s          32767a   varying
>
>          d wCGI_EnvValLen  s             10i 0
>
>          d wCGI_EnvLen     s                   like(wCGI_EnvValLen)
>
>          d wCGI_EnvName    s             20a
>
>          d wCGI_EnvNameLen...
>
>          d                 s                   like(wCGI_EnvValLen)
>
>          d                                     inz(%size(wCGI_EnvName))
>
>          d
>
>           *------------------------------------------------
>
>           /free
>
>              clear wCGI_EnvVal;
>
>              clear wCGI_EnvValLen;
>
>              clear wCGI_EnvNameLen;
>
>              clear dsCGI_Error;
>
>
>              wCGI_EnvName   = pGetEnv;
>
>              wCGI_EnvValLen = %len(%trim(wCGI_EnvName));
>
>
>              CGI_GetEnv(wCGI_EnvVal : wCGI_EnvValLen : wCGI_EnvLen :
>     wCGI_EnvName :
>
>                          wCGI_EnvNameLen : dsCGI_Error );
>
>
>              Return wCGI_EnvVal;
>
>              *inlr = *on;
>
>              /End-free
>
>          p a4g_GetEnv      e
>
>
>     When the program executes, I am getting the following authority errors:
>
>
>          Attempt to use permanent system object QTEMDBSV without authority.
>
>          Attempt to use permanent system object QWTPECTL without authority.
>
>          Attempt to use permanent system object QTEVSIRF without authority.
>
>          Attempt to use permanent system object QTEVINVR without authority.
>
>          Error occurred with input data parameter.
>
>          Attempt to use permanent system object QMHPDEH without authority.
>
>          Attempt to use permanent system object QMHUNMSG without authority.
>
>          Attempt to use permanent system object QWCSCVTR without authority.
>
>          Attempt to use permanent system object QMHRTMSS without authority.
>
>
>     I have used CGIDEV2 and it does not get this error.
>
>
>     V5.4
>
>     User = QTMHHTP1.
>
>
>     The solution may be to change the user id in the program before the
>     call. This will be a first for me.
>
>
>     Can anyone help with the reason for this?
>
>
>     TIA
>
>     Darryl Freinkel | Assignment 400 Group, Inc.
>
>     Tel: 770.321.8562 ext 111 | Fax 770.321.8562
>
>     E-mail: [1]dfreinkel@xxxxxxxxxxxxxxxxx
>
>     Web: [2]www.assignment400.com
>
> References
>
>     1. mailto:dfreinkel@xxxxxxxxxxxxxxxxx
>     2. http://www.assignment400.com/
>
>
>
> -----------------------------------------------------------------------
> 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
-----------------------------------------------------------------------