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
- 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
publicclassEmpLov{
publicEmpLov(){
super();
}
//String variable to hold Employees Name
private String empName;
publicvoidsetEmpName(String empName){
this.empName= empName;
}
public String getEmpName(){
return empName;
}
}
Set List Attribute and Display Attribute and click on Ok button
All Done :) Now run and check application
Cheers :) Happy Learning