4 Replies Latest reply: Mar 20, 2013 5:29 AM by MJaro RSS

    How to change parsing schema for REST

    MJaro
      Hi all,

      I'm trying to test the new REST Webservice feature, but this leads to an error:

      Using Apex 4.2.1.00.08, Listener 2.0.1.64.14.25 I set up a simple WebService (method: GET, format: JSON) which
      querys a table.
      When I try to test my webservice (using "Test" button) the following error is shown:

      Request Path passes syntax validation
      Mapping request to database pool: PoolMap [_poolName=apex, _regex=null, _workspaceIdentifier=null, _failed=false, _lastUpdate=-1, _template=null, _type=REGEX]
      Applied database connection info
      Attempting to process with PL/SQL Gateway
      Not processed as PL/SQL Gateway request
      Attempting to process as a RESTful Service
      Determining if request can be dispatched as a Tenanted RESTful Service
      Request path has one path segment, continuing processing
      No Tenant Principal established yet, continuing processing
      APEX_LISTENER pool exists, continuing processing
      Matching tenant exists, continuing processing
      modul/template/ matches: modul/template/ score: 0
      Choosing: oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as current candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=1019223475312614|5204902308237886, uriTemplate=modul/template/], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true]
      Determining if request can be dispatched as a Tenanted RESTful Service
      Request path has one path segment, continuing processing
      Tenant Principal already established, cannot dispatch
      Chose oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as the final candidate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=1019223475312614|5204902308237886, uriTemplate=modul/template/], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true] for: GET modul/template/
      Choosing: oracle.dbtools.rt.jdbc.entity.JDBCTenantDispatcher as current candidate with score: Score [handle=oracle.dbtools.rt.jdbc.entity.JDBCTenantDispatcher$TenantTarget@1537060, score=1, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true]
      Chose oracle.dbtools.rt.jdbc.entity.JDBCTenantDispatcher as the final candidate with score: Score [handle=oracle.dbtools.rt.jdbc.entity.JDBCTenantDispatcher$TenantTarget@1537060, score=1, scope=SecurityConfig [constraint=none, realm=NONE, logonConfig=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true] for: GET prx/modul/template/
      prx/modul/template/ is a public resource
      modul/template/ is a public resource
      Using generator: oracle.dbtools.rt.json.query.JSONQueryGenerator
      Performing JDBC request as: POFFICE
      Error during evaluation of resource template: ORA-00942: Tabelle oder View nicht vorhanden



      I see what is going wrong: "Performing JDBC request as: POFFICE". JDBC is using a wrong schema ("POFFICE").
      So, my question is, how to change the parsing schema for JDBC/WebService?

      Thanks a lot,

      Michael
        • 1. Re: How to change parsing schema for REST
          VC
          I guess it always uses the First Schema Provisioned to that workspace to parse the restful web-services, So why don't you just grant relevant privileges on the database object(s) to the parsing schema 'POFFICE'.

          And amend the source of the restful definition to include the schema prefix.
          select * from POFFICE.your_table
          • 2. Re: How to change parsing schema for REST
            jfle
            Yes - this is the reason,
            but is there a way to change or delete the first schema provisioned?
            We have deleted the poffice assignment to the workspace, but the REST-service executes with poffice?

            jfle (colleague of mjaro)
            • 3. Re: How to change parsing schema for REST
              VC
              jfle wrote:
              Yes - this is the reason,
              but is there a way to change or delete the first schema provisioned?
              See {message:id=3757162}
              We have deleted the poffice assignment to the workspace, but the REST-service executes with poffice?
              Don't know could be a bug.

              May be try exporting you restful webservice definition > Edit the export file in textpad/notepad and verify the parsing schema

              You will see a block something like below, there just amend the p_parsing_schema to desired > and then import it back
              wwv_flow_api.create_restful_module (
                p_id => 7113266627142076447 + wwv_flow_api.g_id_offset
               ,p_name => 'oracle.example.vikram2'
               ,p_parsing_schema => 'APX'
               ,p_items_per_page => 25
               ,p_status => 'PUBLISHED'
                );
              • 4. Re: How to change parsing schema for REST
                MJaro
                Hi,

                we changed the "p_parsing_schema" to "XYZ" in the export file but the reimport failed:

                "You do not have privileges on the POFFICE schema.
                Contact your application administrator."

                We suppose that there might be a bug with parsing schema vs. first schema provisioned.
                We created a new workspace, rebuild my webservice with first schema provisioned is "XYZ".
                Even the import in the new workspace worked as expected.

                Thanks a lot,

                Michael