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
public class EmpLov { public EmpLov() { super(); } //String variable to hold Employees Name private String empName; public void setEmpName(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
Thank you for this post,
ReplyDeleteActually we have opposite scenario and we need your advice
we need lov on some request attributes
For example:
On request service method we have (long variable1)
On ui we need lov for this variable1 the user select one choice description from database then the value sent to variable1 as value of this description
how we can handle this since we have many variables on all services as best practice??
But why you want to apply Lov on Service attribute ?
DeleteI don't think this is practical, WebServices are used to get you data and you can use that data to apply lov on some attribute
Ashish
Like all other expert web based business web improvement organizations we additionally take after process driven, multi stage approach, which likewise incorporates information demonstrating, necessity examination and definition, quality affirmation and application testing. AMP
ReplyDelete