Search code examples
web-servicesoracle-adfjdeveloper

How to make a result datacontrol between a webservice and ejb datacontrol in ADF?


I need to create a table using the result of a webservice call and a table from another database, how do I do that in ADF?

Thanks


Solution

  • The best way is to aggregate two sources of information is to write use ADF Business Components:

    1. Create a SQL-based View Object for the database table.
    2. Override ViewObjectImpl.executeQueryForCollection() and programatically call your Webservice from this point. You iterate over web service return and for each result you do:

      Row row = this.createRow(); this.insertRow(row); row.setAttribute("..", "..."); ......

    Then, from Datasource point of view, you use your view object as a any normal view object.

    You can also aggregate your logic (both db call and web service call) in a custom method of application module. The method executes the VO which returns all the records, then iterates over existing records in VO, grabs the IDs and calls the web service. After web service returns, you can add the row coming from the web service to your db-based vo.

    Your VO, when showed in UI, will contain both records from DB and Webservice, altogether.