Forum Stats

  • 3,851,654 Users
  • 2,264,009 Discussions
  • 7,904,805 Comments

Discussions

ADF Rest Custom method with action name in URL instead in the request body

Hi ,

I was able to create a ADF Rest with the steps as specified in the blog:


Is it possible we can have request body without parameter like “name" and “parameters" in a custom method ADF REST and have the action name in URL.


Example:

URL: {{hostAddress}}/restapp/rest/1/Employees/action/testCall

Request Body:

[ { "param1":"Hellow" },{"param2":"World"}]

Instead of :

URL: {{hostAddress}}/restapp/rest/1/Employees

Request Body:

{"name":"","parameters":[ { "param1":"Hellow" },{"param2":"World"}]}

Tagged:

Best Answer

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,727 Red Diamond
    Answer ✓

    There is no official version 12.2.1.5. You are using an internal version not available to the public.

    All I'm saying is that you don't even see the method tab in 12.2.1.4 and custom methods are depricated. So, yes, from my point of view you can't do it with ADF REST service.

    It might be possible that you see the tab in your version, but then you have to ask this question to some internal resource.


    Timo

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,727 Red Diamond

    User, tell us your exact JDev version, please!

    Your REST endpoint wouldn't make sense this way. The 'Employees' represent a collection that isn't parameterized by default. That's why you normally add something like 'action' or 'acton/test1' to the endpoint to make sure everybody knows that you do something on the collection of employees.

    I would not encourage you to use the method at all, as in 12.2.1.4 you don't even get it in the wizard. It's easier to create your own REST service and call the application module methods from there. This way you can design your own API, e.g more like OpenAPI instead of relying on JDev and ADF.


    Timo

  • I am using Jdev 12.2.1.5.0.

    I used the above link for reference.

    My actual URL looks like:

    {{hostAddress}}/restApp/resources/11.13.18.05/employees

    I have added manually methodAction tag in the resource xml file , to enable the custom method.

    So you are saying that this is not possible using ADF .

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,727 Red Diamond
    Answer ✓

    There is no official version 12.2.1.5. You are using an internal version not available to the public.

    All I'm saying is that you don't even see the method tab in 12.2.1.4 and custom methods are depricated. So, yes, from my point of view you can't do it with ADF REST service.

    It might be possible that you see the tab in your version, but then you have to ask this question to some internal resource.


    Timo