This discussion is archived
5 Replies Latest reply: Apr 11, 2013 3:34 AM by AndyH RSS

Getting Apex workspace login page when trying to go to RESTful service

patfmnd Newbie
Currently Being Moderated
Hi,
We have Apex 4.2 running with Apex 2.0.1 listener. We are using Weblogic for listener. Apex is working fine, but when we try to test the sample hr RESTful web services we get back to the Workspace login page instead of the Web service. What are we missing in the configurations? We tried to configure the apex.war map-url like this

[oracle@weblogic-dev apex_listener]$ java -jar apex.war map-url type base-path workspace-id hr_example/hr ABCDEV

where hr_example is our schema from which we are running the Workspace RESTful serivce (using the TEST capability of the sample services) and ABCDEV is the name of the instance where Apex 4.2 was installed. '/hr' is the path for the DEMO REstful web services.

Is there a separate config for the RESTful service that we are missing so the only URL mapped is the Workspace login page??

We are currently only running 1 database, but eventually will have 2.

Thanks,
Pat
  • 1. Re: Getting Apex workspace login page when trying to go to RESTful service
    AndyPol Expert
    Currently Being Moderated
    Hello

    Did you run apex restfull script (apex_rest_config.sql)? Did you grant connect to hr via APEX_REST_PUBLIC_USER ? Did you set ACL for them ?
  • 2. Re: Getting Apex workspace login page when trying to go to RESTful service
    patfmnd Newbie
    Currently Being Moderated
    Hi,
    Yes, DBAs say they ran the apex restful script and checked all the ACLs and granted connect to the apex_rest_public_user. I'm not the DBA on this, but more of the 'consumer' of the services. Any ideas on how we can double check these items? If anyone has successfully tested all the sample webservices, please let us know what 'bumps' you had to get through.

    Pat
  • 3. Re: Getting Apex workspace login page when trying to go to RESTful service
    AndyPol Expert
    Currently Being Moderated
    Maybe your admin use some rules (mod_rewrite or other). If you use restful request your url is other then regular apex (there aren't f?p...).
    Sometimes admins for security reasone use rules like above.
  • 4. Re: Getting Apex workspace login page when trying to go to RESTful service
    patfmnd Newbie
    Currently Being Moderated
    Hi,
    We will try to trace what is going on with the routing after pressing 'TEST' button.
    It would be helpful if an Apex ACE or Listener ACE could provide EXACT configurations needed to just get the SAMPLE oracle.example.hr RESTful services working. It would be helpful to know what the 'TEST' button is doing. Would be helpful to know what configs are needed on the Listener configuration of those samples to work and not just the Workspace settings.

    The Apex documentation has good examples, step by step for the Workspace settings for RESTful services, but it would be great if someone could provide provide the same step by step on the Application Builder side.

    I watched the Video provided for RESTful services which steps through both parts -- but the Video somehow cuts out the exact URI being used. I have not been able to get this example requiring an Input parameter working at apex.oracle. com , although I did get a simple query RESTful web service to work.

    Thanks,
    Pat
  • 5. Re: Getting Apex workspace login page when trying to go to RESTful service
    AndyH Journeyer
    Currently Being Moderated
    patfmnd wrote:
    Hi,
    We will try to trace what is going on with the routing after pressing 'TEST' button.
    You could try using 'curl' (utility can be found on most Unix boxes and at http://curl.haxx.se for Windows) to send a request to the service. E.G:
    curl --request POST --verbose --header "Content-Type: text/xml" --data-ascii "<calculate><methane>0.965</methane><ethane>0.018</ethane></calculate>" --url http://loorae01:8080/apex/workspace_name/service_name/calculate
    or
    curl --request POST --header "Content-Type: application/json" --data-ascii "{""methane"":0.965,""ethane"":0.018}" --url http://loorae01:8080/apex/workspace_name/service_name_for_json/calculate
    You should then see what is coming back from the service.

Legend

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