Tuesday, December 27, 2016

ADF BC REST 12.2.1.2 Custom Method JDeveloper Workaround

Some of you who would try to implement custom method with ADF BC REST may face JDeveloper 12.2.1.2 wizard issue. JDeveloper 12.2.1.2 wizard is refusing to register ADF BC REST custom method, but it works perfectly on ADF runtime. Seems to be JDeveloper 12.2.1.1 - 12.2.1.2 bug. There is a workaround to modify REST service configuration manually and include custom method binding.

Sample application (available on GitHub - jetcrud). This sample implements custom method in VO implementation class - testCall:


Method is exposed through client interface:


Now if you go to REST service definition and try to enable this method to be included into REST interface - JDeveloper will report error:


Something wrong happens in RSTCustomMethodTab class:


Workaround - add method call into REST service definition manually. I recommend to do it outside of JDeveloper, as it hangs. Change definition in external editor. This is the example for custom method entry:


a

If you take a look into JDeveloper wizard for REST definition, it still shows method unchecked. But you can ignore it:


To execute custom method through REST call, make sure to use POST and specify method name along with parameters in REST request body:


Make sure not to forget to provide action Content-Type:


Check section for more info - 22.13.5 Executing a Custom Action.

2 comments:

ahmad abuayyash said...

thanks very helpful , i was suffering of this for more than 2 week :-)

Andrejus Baranovskis said...

Very good, now you have solution :)

Andrejus