ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Using an RPGLE program from a webpage

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using an RPGLE program from a webpage

    We have an RPGLE program which is called from a webpage. This process is following thru and calling the functions (CL and RPG) which are doing DB updates. The problem is the webpage does not seem to know when the main process is complete. The RPGLE stored procedure does a SETON LR.

    I'm wondering 2 things...Could one reason be that the RPGLE calls a CL which calls a RPG program be a problem?

    2nd - Since the RPGLE program is simply calling the CL which calls the RPG doing the majority of the work, could we simply convert the CL to CLLE and use it as the stored procedure or can CL's not be used as a stored procedure?

    Thanks.

  • #2
    Re: Using an RPGLE program from a webpage

    Interesting.......Can we see your Cl (i would guess we could put all of the CL code into your RPG.)

    I dont think this is your problem....but.....R you using CGIDEV2 or home grown stuff?

    Jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: Using an RPGLE program from a webpage

      home grown.

      should we use SQLCall to the CL instead of the "call" RPG opcode?

      The CL is doing nothing more than passing some parms onto a call to an RPG. Everything works fine when called natively from the 400, just the webpage is does not seem to recognize and EOJ.

      It's a legacy program otherwise we would probably convert main process to RPGLE and use it as the stored procedure.

      Comment


      • #4
        Re: Using an RPGLE program from a webpage

        How is your program communicating its completion back to the HTTP server?

        Michael
        "Time passes, but sometimes it beats the <crap> out of you as it goes."

        Comment


        • #5
          Re: Using an RPGLE program from a webpage

          It calls a CL with an input parm from the server.
          Moves "OK" to an output parm and
          Sets on LR...

          Comment


          • #6
            Re: Using an RPGLE program from a webpage

            Originally posted by dhuesman
            It calls a CL with an input parm from the server.
            Moves "OK" to an output parm and
            Sets on LR...
            But that is not telling the server how to respond to the request from the browser that made the request in the first place. The server needs to send a response back to the browser, like, say, a new page. Simply replying to the server with an "OK" does absolutely nothing.

            Check out the CGIDEV2 page on IBM.com for information on how to have your RPGLE program build a web page to send back to the user.
            "Time passes, but sometimes it beats the <crap> out of you as it goes."

            Comment


            • #7
              Re: Using an RPGLE program from a webpage

              Got it now.

              Seemed the problem was we needed to not be closing the cursor and simply issue a RETURN.

              In this stub process we are simply declaring a cursor, opening the cursor, setting the result set and then RETURN without closing the cursor.

              Why the close would hang the connection is beyond me, but it works...

              Comment

              Working...
              X