Quantcast
Channel: Ashish Awasthi's Blog
Viewing all articles
Browse latest Browse all 165

Populate select one choice using Web Service Data Control in ADF Application

$
0
0

My previous post was about creating a JAX-WS Web Service from Java Bean and consuming web service and showing data in ADF table. Now In this post, I am going to elaborate about consuming that Web Service in ADF Application and show Employees data in selectOneChoice component


So for this requirement, We need to use Web Service Data Control and from that WSDL we can create ADF Faces components

Let's see how to implement this

  • Create a Fusion Web Application


  • Right click on Model project and Select
    New-- From Gallery-- Business Tier -- Data Controls-- Web Service Data Control


  • Copy WSDL URL of Web Service that we created in the previous blog post and give Name and URL in WSDL creation wizard


  • Click on Next and shuttle method to selected side that you want to consume, Here I have selected getEmpList method


  • Click on Finish, We can see that DataControls.dcx file is generated. This file has list of data controls used in project and necessary information to initialize data control


  • Now create a Java Class in model project to hold selectOneChoice value


  • Java Code of EmpLov Java Class

    publicclassEmpLov{
    publicEmpLov(){
    super();
    }
    //String variable to hold Employees Name
    private String empName;

    publicvoidsetEmpName(String empName){
    this.empName= empName;
    }

    public String getEmpName(){
    return empName;
    }
    }

  • Right Click on Java Class and select Create Data Control


  • Now you can see it appears under Data Control


  • Drop empName on page as select one choice and configure it
 Click on Add button to select List Data Source and select Web Service


 Set List Attribute and Display Attribute and click on Ok button


All Done :) Now run and check application

Cheers :) Happy Learning

Viewing all articles
Browse latest Browse all 165

Trending Articles