Next ADF Training
Join Demo Session
Toggle Bar
  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that have been used in the blog.
  • Bloggers
    Bloggers Search for your favorite blogger from this site.
  • Team Blogs
    Team Blogs Find your favorite team blogs here.
  • Archives
    Archives Contains a list of blog posts that were created previously.
  • Login
    Login Login form

How to expose custom AM method as a webservice in Oracle ADF Part 3

Posted by on in ADF Webservices
  • Font size: Larger Smaller
  • Hits: 5049
  • 1 Comment
  • Subscribe to this entry
  • Print
  • Report this post

Oracle ADF has helped us to develop a webservice with ADF BC pretty fast by using the service interface of the App Module.In the last version of this webservice, we just created an EO,VO and exposed the AM methods as a webservice.What if you need a custom functionality written in a custom method in the AM to be exposed as a webservice? We have an option in the service interface of the AM to expose the custom methods in AM as a webservice method too.

Lets start by creating the custom method in the AM.

Step 1: Add below custom method to the AM.

   1: public List<DepartmentsVORowImpl> findCholaDepartmentsByName(String DepartmentName) {
   2:     List<DepartmentsVORowImpl> result = new ArrayList<DepartmentsVORowImpl>();
   3:     ViewObjectImpl vo = getDepartments1();
   4:     vo.setWhereClause(null);
   5:     vo.setWhereClauseParams(null);
   6:     vo.setWhereClause(" DEPARTMENT_NAME = :1");
   7:     vo.setWhereClauseParam(0, DepartmentName);
   8:     //  vo.setForwardOnly(true);
   9:     vo.executeQuery();
  10:     while (vo.hasNext()) {
  11:         result.add((DepartmentsVORowImpl)vo.next());
  12:     }
  13:     return result;
  14: }

Step 2: Expose the custom method as a webservice method.

kbwhonnu

lpoewpsy

b2bzzjzf

ghhv5rw5

Step 3 : Lets run the webservice to test the custom AM method webservice.

ta0t01zk

kpwoycx5

Voila.. We are done with exposing a custom AM Method as an webservice operation in Oracle ADF.Though this is not the exact usecase for the custom method, it helps us to understand the usage of custom methods in AM as a webservice operation.

As usual, you can check out the code from code.adfapps.com website from the below url.

https://code.adfapps.com/svn/adfwebservices

adftraining/adftraining

Tag Name in SVN : CUSTOM_METHOD_WEBSERVICE

© Creative Commons Attribution Assurance 3.0 License
0

People in this conversation

  • Guest - Eduard

    Hi Sudhakar, i can't download the example files, cause the page don't start the download files after i type the credentials. Please help me.

    0 Like Short URL:

Login