Jesus,

yo lo que tengo es parecido y no se si te sirve, pero hay va:

En la llamada GET o POST paso los parametros como tu href =
"cgi-bin/programa.pgm?PARM1=aaaaa",

y en el programa.pgm leo el string de entrada a traves de la API y despues
actuo en consecuencia.

te mando un ejemplo de como lo leo.

GTIWWW/BUSCAPGM

     H ALWNULL(*INPUTONLY)
      *
      * Incluir prototipos
      *
     D/Copy GTIWWW/QRPGSRC,CGIPROTO
      *
      * Variables para el CGI interface API QtmhGetEnv y QtmhRdStin
      *
     D InBuffer        S           2048A
     D InBufLen        S             10I 0 Inz(%Size(InBuffer))
     D InActLen        S             10I 0
     D EnVarName       S             64A
     D EnVarLen        S             10I 0
      *
      * Variables para el CGI interface API QtmhWrStout
      *
     D OutBuff         S           2048A
     D OutBuffLn       S             10I 0 Inz(%Size(OutBuff))
     D OBUFFER         S           2048A
      *
      *
      *
      *
      * Data structure for error reporting, from QSYSINC/QRPGLESRC(QUSEC)
      *
     D QUSEC           DS
      *                                             Qus EC
     D  QUSBPRV                      10I 0 Inz(16)
      *                                             Bytes Provided
     D  QUSBAVL                      10I 0
      *                                             Bytes Available
     D  QUSEI                         7
      *                                             Exception Id
     D  QUSERVED                      1
      *                                             Reserved
      *QUSED01                17    116
      *                                      Varying length
      *---------------------------------------------------------------------
      * Get the Environment Variable called REQUEST_METHOD
      * Set the EnVarName to REQUEST_METHOD
      * Set the EnVarLen to the length of this string
      *
      *
     C                   Eval      EnVarName = 'REQUEST_METHOD'
     C                   Eval      EnVarLen = %Len(%Trim(EnVarName))
     C                   CallP     APIEnVar(InBuffer:InBufLen:InActLen:
     C                             EnVarName:EnVarLen:QUSEC)
      * METODO GET
      *
     C                   If        %Subst(InBuffer:1:3) = 'GET'
      *
      * Get the Environment Variable called QUERY_STRING
      * Set the EnVarName to QUERY_STRING
      * Set the EnVarLen to the length of this string
      *
     C                   Eval      EnVarName = 'QUERY_STRING'
     C                   Eval      EnVarLen = %Len(%Trim(EnVarName))
     C                   CallP     APIEnVar(InBuffer:InBufLen:InActLen:
     C                             EnVarName:EnVarLen:QUSEC)
     C                   Else
      *
      * METODO - POST
      *
      * Get the Environment Variable called CONTENT_LENGTH
      * Set the EnVarName to CONTENT_LENGTH
      * Set the EnVarLen to the length of this string
      *
     C                   Eval      EnVarName = 'CONTENT_LENGTH'
     C                   Eval      EnVarLen = %Len(%Trim(EnVarName))
     C                   CallP     APIEnVar(InBuffer:InBufLen:InActLen:
     C                             EnVarName:EnVarLen:QUSEC)
      *
      * Convert received length from character into number
      *
     C                   Eval      PostLenCh = *Zeros
     C                   Eval      %Subst(PostLenCh:6-InActLen:InActLen)
     C                             = %Subst(InBuffer:1:InActLen)
     C                   Move      PostLenCh     PostLen
      * Get the input parameters from STDIN using POST method
      *
     C                   Z-Add     PostLen       InBufLen
     C                   CallP     APIStdIn(InBuffer:InBufLen:InActLen
     C                             :QUSEC)
      *
     C                   EndIf
      *
      *

 ----> A PARTIR DE AQUI TIENES EN LA VARIABLE INBUFFER LOS PARAMETROS
PASADOS.


PROTOTIPOS DE LAS APIS

GTIWWW/QRPGSRC/CGIPROTO

      *---------------------------------------------------------------------
      * Filename CGIPROTO      GTIWWW/QRPGSRC
      *---------------------------------------------------------------------
      * Prototipo para API QtmhGetEnv
      *
     D APIEnVar        PR                  ExtProc('QtmhGetEnv')
     D  RcvBuffer                  2048A
     D  RcvBufferLen                 10I 0
     D  RspActualLen                 10I 0
     D  EnvVarName                   64A
     D  EnvVarLen                    10I 0
     D  ErrorBuffer                  16
      *
      * Prototipo para API QtmhRdStin
      *
     D APIStdIn        PR                  ExtProc('QtmhRdStin')
     D  RcvBuffer                  2048A
     D  RcvBufferLen                 10I 0
     D  RspActualLen                 10I 0
     D  ErrorBuffer                  16
      *
      * Prototipo para API QtmhCvtDb
      *
     D APICvtDb        PR                  ExtProc('QtmhCvtDb')
     D  DBFileName                   20A
     D  DBBuffer                   2048A
     D  DBBufferLen                  10I 0
     D  DBStructure                  60
     D  DBStructLen                  10I 0
     D  DBActualLen                  10I 0
     D  DBRespCode                   10I 0
     D  ErrorBuffer                  16
      *
      * Prototipo para API QtmhWrStout
      *
     D APIStdOut       PR                  ExtProc('QtmhWrStout')
     D  OutBuffer                  2048A
     D  OutBufferLen                 10I 0
     D  ErrorBuffer                  16
      *
      * Prototipo para API QCMDEXC - EJECUTAR PROGRAMA
      *
     D ExecCommand     PR                  ExtPgm('QCMDEXC')
     D  CommandTxt                  256A
     D  CommandLen                   15P 5
      *
      * Prototipo para procedimiento $GetEnv
      *
     D $GetEnv         PR
     D  EnvVarName                   64A
     D  RcvBuffer                  2048A
     D  RspActualLen                 10I 0
      *
      * Prototipo para procedimiento $RdStin
      *
     D $RdStin         PR
     D  RcvBuffer                  2048A
     D  RspActualLen                 10I 0
      *
      * Prototipo para procedimiento $WrStout
      *
     D $WrStout        PR
     D  OutBuffer                  2048A   Value
      *
      * Fin de prototipos
      *



espero que te sirva.

Jos� Luis Hernando
Dpto. Informatica
TEL: 91 322 21 63 - 91 322 21 00
FAX: 91 322 21 29
MAILTO:jlhernando@;quelle.es
Distribuci�n Quelle La Source


-----Mensaje original-----
De: [EMAIL PROTECTED]
[mailto:forum.help400-request@;combios.es]En nombre de Arbues Sanz, Jesus
Enviado el: lunes, 04 de noviembre de 2002 14:03
Para: [EMAIL PROTECTED]
Asunto: Llamada a PGM desde un HTML


Hola compa�eros, buenas tardes.

        Estoy haciendo una llamada desde un HTML al directorio que tengo
publicado como cgi-bin en el i-Series, el programa que ejecuto es un simple
CL que me envia un mensaje, si realizo la referencia sin parametros, me
funciona correctamente. En cambio si ejecuto con un programa con parametros
me da error que dice que los parametros no coinciden, he probado con
formularios (con GET y POST), href = "cgi-bin/programa.pgm?PARM1=aaaaa", y
tampoco.

        No se si se puede hacer tan sencillo o en el programa tengo que
hacer algo m�s.

        Si alguno me podeis ayudar os lo agradecere, gracias de antemano.


        Jes�s Arbu�s

_____________________________________________________
Forum.HELP400 es un servicio m�s de NEWS/400.
� Publicaciones Help400, S.L. - Todos los derechos reservados
http://www.help400.es
_____________________________________________________

Para darte de baja, env�a el mensaje resultante de pulsar
mailto:forum.help400-request@;combios.es?body=LEAVE


_____________________________________________________
Forum.HELP400 es un servicio m�s de NEWS/400.
� Publicaciones Help400, S.L. - Todos los derechos reservados
http://www.help400.es
_____________________________________________________

Para darte de baja, env�a el mensaje resultante de pulsar
mailto:forum.help400-request@;combios.es?body=LEAVE

Responder a