Sunday, April 12, 2015

ADF BC Web Service - Return List of Complex Types

ADF Business Components can be exposed as SOAP Services. Application Module provides Service Interfaces as a way to define operations for the services to be exposed. Custom methods written in AMImpl class can also be exposed as operation of web services.

But one of the limitation is that there is restriction on return types from the services exposed as service interface from Application Module.

In this post we will see how easily we can develop a web service using ADF BC Service Interface and can tweak/use one of the given returnType List<ViewRowImpl>  to return list of complex type object.

Use case here is to create an operation in ApplicationModuleImpl class to return List of Object consiting of three variables -  DepartmentName,ManagerId,IsManagerFlag and expose the operation as ADF BC Service Interface SOAP Service. (Jdeveloper

So Lets get started

Created a simple ADF Web Application using HR Schema and created DepartmentsEO , VO and AM and there respective Java Classes.

Create a Programmatic VO - WSResultPVO which will be returned from the operation of the WebService.

Now Add three variables in the PVO. DepartmentName,ManagerId and IsManagerFlag. 

Generate Necessary VOImpl and RowImp classes and set datatypes for the variables.

Remember to make these variables set AlwaysUpdatable as below.

Do a next and finish.

Now write a method in AMImpl class which has a code below. This method is an operation of the Web Service which will return the List of Complex type.

As clear from the code, the rows of WSResultPVO is being set programmatically. DepartmentsVO is iterated and value of DepartmentName and ManagerId is fetched and set into the rows of WSResultPVO. IsManagerFlag is being set Y here which can be changed based on any logic in real time use cases. 

At last the WSResultPVO row is added to the List - returnList which is being returned by the operation method.

We are all done with code part. Now lets quickly create service interface and expose the web service.

Go to Service Interface tab of AM. Click on Green Add Icon.

Here you can define the service name. We will go with default for this example.

On Next screen just shuttle the method which we need to expose and which is there in AMImpl class.

We need to define what will be the return type from the operation. So expand the shuttled method and click java.util.List and select WSResultPVO from below as shown below.

Do next and finish. Below will be added to Service Interface.

Thats it we are done now. Just Run the newly generated serviceImpl class from serviceInterface.

After running, there will be link of the exposed service and one can test it. Just click the operation and below shown will be the results.

So by using ViewRowImpl, we can return List of complex type object which can carter requirement of having complex type returned from the service.



  1. Good to know that! Do you know if its possible to work with this List in Oracle MAF? I have a requirement to create a Web Service to return a complex list and show on my Mobile Application.
    Thank you.

  2. Thanks Rohan.
    It is a very useful for exposing complex type (Return type )webservice !!!!
    waiting for more useful POC's

  3. Replies
    1. An important building block of SEO is to develop your website which can be easily understandable for both Online Visitors (most important) and search engine robots. In the current digital age, seo is important for your online success means to generate leads.

      SEO Services in IndiaSEO Company in India SEO Company in India SEO Services in India

      SEO Company in India SEO Services in India

  4. A very good and informative article indeed. It helps me a lot to enhance my knowledge. Keep sharing in future.I will be waiting for your next blog.
    latest technologies in computer

  5. Hi Rohan,
    Thanks for nice blog.
    I have a scenario where I want to return Master-Detail data as Complex Return Type.
    Can you help me on this on How to achive this?

    Kaustubh Patel.

    1. This comment has been removed by the author.

    2. This comment has been removed by the author.

  6. This article provide excellent information. I really like it and understand many things from here this page, Professional web app developer USA

  7. This blog is so nice to me. I will keep on here again and again. Visit my link as well..
    SEO services pakistan

  8. Hello, I tried but I get the following error, I use ADF 10.3g
    serialization error: no serializer is registered for(class,null) serialization error:

  9. "Great blog created by you. I read your blog, its best and useful information. You have done a great work. Super blogging and keep it up.php jobs in hyderabad.

  10. If you want your ex-girlfriend or ex-boyfriend to come crawling back to you on their knees (even if they're dating somebody else now) you gotta watch this video
    right away...

    (VIDEO) Have your ex CRAWLING back to you...?

  11. Great blog you have written for us Thanks for sharing good content keep sharing... check it once through MSBI Online Training for more information on microsoft.

  12. hi
    what type of deployment(eg JAR ,SAR,WAR) could i deploy for this application, so i can reuse this web service in other applications

  13. • Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updatingAzure Online Training HYDERABAD

  14. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking
    Internet Marketing Companies Bangalore
    Digital Marketing Company Bangalore
    Best SEO Services in Bangalore

  15. Good article , everybody like this, You are so awesome! I don’t suppose I’ve truly read through a
    single thing like this before. So wonderful to find somebody
    with some original thoughts on this topic. Seriously.. thank
    you for starting this up. This website is one thing that is required on the web, someone with a little originality!

  16. Nice information that you have shared with us. It's and interesting blog. Thanks for sharing nice information. Here I also want to share a site London web design and it will be beneficial for others.

  17. Wow it is really wonderful and awesome thus it is veWow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your site.ry much useful for me to understand many concepts and helped me a lot.
    Best Oracle ADF Course in Bangalore

  18. last month he share is herbal medicine in some medical hospital and now he is well recognize as one of the best in West Africa, you don’t have to be sad any more or share your tears any more on this virus when the cure have already be find in 2013 if you want to get in touch with him in private contact him on his email Or you can visit his website on https:// or