This discussion is archived
3 Replies Latest reply: May 8, 2013 5:02 AM by patfmnd RSS

Problem with RESTful web service with header value

patfmnd Newbie
Currently Being Moderated
Hi,
I am on Apex 4.2.2 and Listener 2.1 and the listener is on WEblogic.
I succeeded to get a RESTful web service working in an application with no header to obtain a full set of data. The data set is very large, so I am now just trying to set up a web service to get a set of data based on a student ID.

I followed the examples shown in the RESTful web service module of SQL Workshop and set up a handler of this type:
https://ourweblogicserver/apex/bnr/ace/students/course_grades/{stid}

The test for this handler succeeded both for JSON output and CSV output in the Workshop test environment.

However, when I try it from a Web Service Reference that I created for my application following what looked like the same approach used on the example video, I get NO data back. If I put a 'stid' directly into a URL of a web browser and do the basic authentication I get the data!!

This is what I have for the Web service reference:
https://ourweblogicserver/apex/bnr/ace/students/course_grades/{stid}
Basic auth set to Yes -- and this is working -- I am able to authenticate
HTTP method Get
output format Text
no response Xpath
no response namespace
defaults for new record and parameter delimiter

NO REST input parameters
Output set for all the fields in the data set queried (same set of data as in my rest service which does not have any http header)

REST HTTP Header : Name stid


I there something I am missing. I am not sure how to troubleshoot this further.

Pat
  • 1. Re: Problem with RESTful web service with header value
    Colm Divilly Journeyer
    Currently Being Moderated
    Hi Pat,
    not really able to determine what your question is, if you need to be able to trace the request in more detail, see here for information on how to turn on logging:

    https://cdivilly.wordpress.com/2013/03/08/configuring-logging-in-oracle-application-express-listener-2-0-1/

    Othewise I suggest you create a RESTful Service on apex.oracle.com to demonstrate the problem you are facing, you should be able to mock something up that gives the gist of what you are trying to do.
  • 2. Re: Problem with RESTful web service with header value
    patfmnd Newbie
    Currently Being Moderated
    Hi,
    I have posted a simple application with the RESTful reference:
    http://apex.oracle.com/pls/apex/f?p=13758

    I can give you full privileges on this so you can look at the WEB service reference. Shall I send to you separately for login user?

    It is using the RESTful service: http://apex.oracle.com/pls/apex/nd_pat_miller/demo/employee/{deptno}
    This RESTful service tests fine when I test from within the RESTful web service module of the Workspace.

    I based this on the Video demo tutorial for RESTful web service that Oracle published for 4.2 release. The video seemed to exclude the {deptno} in the URL but when I try that, it doesn't work either.

    This is the error I am getting when I run this on my Apex environment: (it, of course, will not run the web service in the apex.oracle.com environment)
    class="statusMessage">Bad Request</span>                                          
    </h3>                                          
    </div>                                          
    </div>                                          
    <div id="xWhiteContentContainer" class="xContentWide">                                          
    <div class="xWhiteContent">                                          
    <div class="errorPage">                                          
    <p>                                          
    <ul class="reasons"><li class="badRequestReason"><span class="target" style="display:none;">uri</span><span class="reason">Request path contains unbound parameters: deptno</span></li>                                     
    </ul>
    Thanks,
    Pat

    Edited by: patfmnd on May 8, 2013 3:33 AM
  • 3. Re: Problem with RESTful web service with header value
    patfmnd Newbie
    Currently Being Moderated
    I was able to resolve my issue -- I actually went through the steps of the video over again and realized I had left out the creation of the header parameter. Once I created that header parameter in the web service all worked fine!!

    Pat

Legend

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