5 Replies Latest reply on May 13, 2016 3:51 PM by Kris Rice-Oracle

    Can't get procedure.preProcess to work in listener 3.04 standalone

    mark123

      Configuration

      Oracle 11g XE on Windows 8.1

      Apex 4.2

      Ords Listener 3.04 standalone

       

      I'm trying to call a PL/SQL  procedure  using procedure.preProcess to read a request header  for RESTful services configured using Apex (i.e. I'm not using SQL Developer).

      I've tried adding the procedure.preProcess parameter in both the apex_rt.xml and default.xml files (in fact I've now tried it in all the configuration files) and it seems to be ignored. I'm editing the files by hand rather than using SQL Developer.  The setting is displayed on the command line output indicating that the listener has picked up the entry but the procedure never seems to get called.  I've checked this by amending the procedure to simply unconditionally log to a table and even tried to generate an error by providing a non-existent procedure name. Am I missing something ?

        • 1. Re: Can't get procedure.preProcess to work in listener 3.04 standalone
          mark123

          Shedding some more light on this.

           

          It doesn't seem to work with the 2.0.1 listener either BUT...

           

          if procedure.preProcess is added to defaults.xml, the call is made for an Apex URL but not for a REST one.

           

          so  localhost:8080/ords/workspace/ 

           

          brings up the Apex login page  and makes a call to the preProcess procedure

           

          but localhost:8080/ords/workspace/module/template  calls the GET handler  for module/template  but doesn't call the preProcess procedure

          • 2. Re: Can't get procedure.preProcess to work in listener 3.04 standalone
            mark123

            Debug output for Apex URL  -- localhost:8080/ords/workspace/

            =====================

            Determining if request can be dispatched as a Tenanted RESTful Service

            Request path does not have a path segment, cannot dispatch

            No candidate found for: GET  in context: http://localhost:8080/ords/workspace/

            ==== Processing Request: ====

            GET /ords/workspace/

            ==== Headers in Request ====

            etc etc

            ==== Cookies in Request ====

            etc etc

            sing default page: apex

            SID: 95

            isValidRequest(), procedure name: <apex>

            Validating: apex

            *** Total number of arguments: 1

            ProcedureUtils.execute():

            declare

            begin

              schema.package.procedure_for_preprocessing;

            end;

            Parse: 0 ms

            -----

            begin

            apex;

            commit;

              end;

            *** Total number of arguments: 1

            Exec: 8 ms

             

             

             

            Debug output for  RESTful URL -- GET  localhost:8080/ords/workspace/module/template

            =====================

             

            module/template matches: module/template score: 0

            Choosing: oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as current candidate with score: Score [handle=ResourceTemplateMatch........

            Determining if request can be dispatched as a Tenanted RESTful Service

            Request path has one path segment, continuing processing

            No matching tenant found for: module, cannot dispatch

            Chose oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as the final candidate with score: Score [handle=ResourceTemplateMatch..........

            module/template is a public resource

            Using generator: oracle.dbtools.rt.json.query.SingleRowGenerator

            Performing JDBC request as: A_SCHEMA

            • 3. Re: Can't get procedure.preProcess to work in listener 3.04 standalone
              Kris Rice-Oracle

              >>if procedure.preProcess is added to defaults.xml, the call is made for an Apex URL but not for a REST one.

               

              This is correct, pre/post only apply to the OWA/Apex side. 

              • 4. Re: Can't get procedure.preProcess to work in listener 3.04 standalone
                mark123

                That's somewhat unfortunate.  I can think of a lot of reasons I might want to do something (or not) with all RESTful service calls  e.g. populate various dbms_application_info variables from headers and/or URI so we can relate backend issues to the actual call at the frontend.  Looks like we'll just have to remember to include a handcoded call to a pre-processor procedure in each POST/PUT and indulge in some deterministic function trickery for the GETs.

                 

                Is the situation ever likely to change for RESTful calls and,  if so, would that include the Apex defined ones or are we just waiting for those to be quietly dropped at some point.

                 

                Cheers

                • 5. Re: Can't get procedure.preProcess to work in listener 3.04 standalone
                  Kris Rice-Oracle

                  It's on the list and coming for the rest side of the world just not there today. Eventually, the apex defined ones will go away for the sole reason it's so confusing that those are different and why.

                  1 person found this helpful