This discussion is archived
1 Reply Latest reply: Mar 27, 2013 10:22 AM by Zack.L RSS

Restful service unable to insert data using PL/SQL.

Zack.L Explorer
Currently Being Moderated
Hi all,
Am running:
AL 2.01 standalone mode on OEL 4.8 in VM box A.
Oracle database with Apex on OEL4.8 in VM box B.

Able to performed Restful services with no problem.

Using the below example:
   Workspace : wsdemo
 RESTful Service Module:  demo/
          URI Template:      test
                Method:  POST
           Source Type:  PL/SQL
 insert into scott.json_demo values(:title,:description);
which uses the following table (under schema: scott):
create table json_demo ( title varchar2(20), description varchar2(1000) );
grant all on json_demo to apex_public_user;
Errors encountered when set bind variable and Test:

==== Request Processed ====
Processed PL/SQL Gateway request
Request Path passes syntax validation
Mapping request to database pool: PoolMap [_poolName=apex, _regex=null, _workspaceIdentifier=WSDEM                          O, _failed=false, _lastUpdate=1364313600000, _template=/wsdemo/, _type=BASE_PATH]
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
demo/test matches: demo/test score: 0
Choosing: oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher as current cand idate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=2648625079503782|2797815                          111031405, uriTemplate=demo/test], score=0, scope=SecurityConfig [constraint=none, realm=NONE, log                          onConfig=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 candid ate with score: Score [handle=JDBCURITemplate [scopeId=null, templateId=2648625079503782|279781511                          1031405, uriTemplate=demo/test], score=0, scope=SecurityConfig [constraint=none, realm=NONE, logon                          Config=LogonConfig [logonForm=null, logonFailed=null]], originsAllowed=[], corsEnabled=true] for: GET demo/test
demo/test is a public resource
WebException [statusCode=405, allowableMethods=[POST]]
     at oracle.dbtools.rt.web.WebException.webException(
     at oracle.dbtools.rt.web.WebException.methodNotAllowed(
     at oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplates.allowableMethods(
     at oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplates.resourceHandler(
     at oracle.dbtools.rt.resource.templates.v2.ResourceTemplatesDispatcher.dispatch(
     at oracle.dbtools.rt.resource.templates.jdbc.JDBCResourceTemplateDispatcher.dispatch(
     at oracle.dbtools.rt.web.RequestDispatchers.dispatch(
     at oracle.dbtools.rt.web.HttpEndpointBase.restfulServices(
     at oracle.dbtools.rt.web.HttpEndpointBase.service(
     at javax.servlet.http.HttpServlet.service(
     at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.doFilter(
     at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.invokeFilterChain(
     at com.sun.grizzly.http.servlet.ServletAdapter.doService(
     at oracle.dbtools.standalone.SecureServletAdapter.doService(
     at com.sun.grizzly.http.servlet.ServletAdapter.service(
     at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(
     at com.sun.grizzly.tcp.http11.GrizzlyAdapterChain.service(
     at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(
     at com.sun.grizzly.http.ProcessorTask.invokeAdapter(
     at com.sun.grizzly.http.ProcessorTask.doProcess(
     at com.sun.grizzly.http.ProcessorTask.process(
     at com.sun.grizzly.http.DefaultProtocolFilter.execute(
     at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(
     at com.sun.grizzly.DefaultProtocolChain.execute(
     at com.sun.grizzly.DefaultProtocolChain.execute(
     at com.sun.grizzly.http.HttpProtocolChain.execute(
     at com.sun.grizzly.ProtocolChainContextTask.doCall(
     at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(
     at com.sun.grizzly.util.AbstractThreadPool$
Thanks in advance
  • 1. Re: Restful service unable to insert data using PL/SQL.
    Zack.L Explorer
    Currently Being Moderated
    Ok, just read from the below that TEST button is only for GET request.
    Oracle® Application Express Listener
    Release Notes
    Release 2.0
    February 2013
    Oracle Application Express RESTful Service Test Button
    The Oracle Application Express RESTful Services UI includes a Test button that may
    be used to test RESTful Services. In Oracle Application Express release 4.2, this button
    is enabled for all kinds of Resource Handlers, but note that it is only actually able to
    test GET Resource Handlers.


  • Correct Answers - 10 points
  • Helpful Answers - 5 points