6 Replies Latest reply on Jul 20, 2016 8:02 PM by 3280623

    Install ORDS with out APEX

    Rahul Gaddam-Oracle

      Hi,

       

      Please confirm if ORDS can be installed with out APEX.

      I have tried steps given in the documentation https://docs.oracle.com/cd/E56351_01/doc.30/e56293/install.htm#AELIG7181 but failed to install.


      After successful installation, getting below. Successfully create ORDS_METADATA and ORDS_PUBLIC_USER.

       

      Ords.png

       

      Regards,

      Rahul

        • 1. Re: Install ORDS with out APEX
          xilan

          Hi Rahul,

           

          This is expected. Read the following section in readme.html

           

          404 Errors when configuring Oracle REST Data Services

          ...

          If you do not use Application Express then there will be no stored procedure available to serve the /ords/ resource. This means that accessing this URL will produce a 404 - Not Found status, this is expected.

           

          Thanks,

          Xiaohe

          1 person found this helpful
          • 2. Re: Install ORDS with out APEX
            Rahul Gaddam-Oracle

            Thanks a lot for the update.

             

            Please confirm if there is any possibility of exposing PLSQL or SQL queries as RestFull Web services with ORDS and with our APEX.

             

            Regards,

            Rahul

            • 3. Re: Re: Install ORDS with out APEX
              xilan

              Hi Rahul,

               

              Yes, you can define ORDS RESTful Services to be exposed without APEX.

              The following is an example on how to do this.(Please refer to the documentation or the tutorial for more information about those APIs and how the resource can be exposed):

               

              SQL> show user
              USER is "SCOTT"
              SQL> begin
                2  ords.enable_schema;
                3  commit;
                4  end;
                5  /
              
              
              PL/SQL procedure successfully completed.
              

               

              SQL> list
                1  begin
                2    ords.define_service(
                3 p_module_name => 'foo.bar',
                4 p_base_path => 'foobar/',
                5 p_pattern => 'dummy',
                6 p_method  => 'GET',
                7 p_source      => 'select * from dual');
                8    commit;
                9* end;
              SQL> /
              
              
              PL/SQL procedure successfully completed.
              
              
              SQL>
              

               

              Then access the resource via a URL like:

              curl -i http://localhost:8080/ords/scott/foobar/dummy
              

               

              Thanks,

              Xiaohe

              1 person found this helpful
              • 4. Re: Install ORDS with out APEX
                Rahul Gaddam-Oracle

                Thanks a lot Xiaohe.

                 

                Your solution worked, I am now able to host ords.war in Apache Tomcat with our APEX and create RESTful services.

                One finally request, Can you please share any documentation or example on below:

                1. Using POST method to read JSON array into Oracle Table Type and update Database with ORDS.DEFINE_SERVICE().
                2. Any restrictions on PL/SQL data types that can be used with ORDS - p_source_type(source_type_plsql).
                3. Where are database details store in deployed ords.war file. I have ords.war deployed in Tomcat and successfully creating connection to database that i configured using C:> java -jar ords.war install advanced

                 

                Regards,
                Rahul

                • 5. Re: Install ORDS with out APEX
                  xilan

                  Hi Rahul,

                  1.The following is POST example(Assume the schema is scott and the table is emp).

                  begin
                    ords.enable_schema;
                    commit;
                  end;
                  /
                  begin
                    ords.define_service(
                      p_module_name  => 'foo.bar',
                      p_base_path    => 'hr/',
                      p_pattern      => 'employees/',
                      p_method       => 'POST',
                      p_source_type  => ords.source_type_plsql,
                      p_source       => 'begin
                                           insert into emp (empno, ename, job, mgr, sal, comm, deptno) values (:empno, :ename, :job, :mgr, :sal, :comm, :deptno);
                                           commit;
                                         end;'
                    );
                    commit;
                  end;
                  /
                  

                  Now make a POST request to insert data:

                  curl -i -X POST -H'Content-type: application/json' -d'{"empno":"9000", "sal":"1000", "ename":"foobar", "deptno":"10"}' http://localhost:8080/ords/scott/hr/employees/
                  

                   

                  2.I don't see there is a restriction myself.

                  3.In ords.war there is an entry in WEB-INF/web.xml pointing to the configuration folder, the database details can be then query from the configuration folder.

                      <context-param>
                          <param-name>config.dir</param-name>
                          <!-- Enter the location where configuration settings should be stored -->
                          <param-value>/scratch/xilan/tempords/conf</param-value>
                      </context-param>
                  

                   

                  Hope this help.

                   

                  Thanks,

                  Xiaohe

                  1 person found this helpful
                  • 6. Re: Install ORDS with out APEX
                    3280623

                    Hi guys.

                    I tried the same installation , whitout apex, but im experiencing an unusual delay on services, like 1.5 sec + on HTTP GET.

                    Whit Spring Data Rest gets 20 50 ms.

                     

                    I think apex create some kind of proxy/cache to speed up ORDS.

                    I will try to install APEX next days and come back.