|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
Feature Java Feature: Putting a Face on Web Services and SOA
It's easier than you think
May. 1, 2006 03:00 PM
We'll now modify it to call our BPEL Web Service. Before we can call the service, we must create a Web Service proxy class which will provide a way to call the service from Java. To create the proxy class, you can use the Web Service Proxy wizard in JDeveloper (File->New...->Business-Tier->Web Services->Web Service Proxy). As the wizard commences, all that is needed to generate the necessary proxy to call the BPEL Web Service is to supply the WSDL URL http://localhost:9700/orabpel/default/LoanCompare/1.0/LoanCompare?wsdl (Figure 16). Accept the remaining defaults and click Finish to generate the Proxy code. As the code generates you will see a Java Proxy client, LoanCompareWSHttpPortClient.java which is a runnable Java client with a main method. The main method looks like:
public static void main(String[] args) { You can issue a test call to the Web Service by adding the line: System.out.println(myPort.getLoanrate("123-45-6789")); To the location denoted by the comment "// Add your own code here". The next step is to modify the action method linked our button with code to call the BPEL Web Service using the Proxy class, "LoanCompareWSSoapHttpPortClient". Jumping back into the backing bean code, "Form.java", we will edit the action method, "" as follows:
public String commandButton1_action() { Now when the button is clicked at runtime, the proxy class, myPort, will be instantiated and the invokeCompareLoan( ) method is invoked and the Social Security value passed from the form is supplied as an argument. The BPEL Web service initiates on the BPEL Process Manager server and determines the lowest loan rate and returns it into the returnedRate float variable. This variable is then applied to the Output Text (outputText1) Faces UI component and a "success" String is returned (Figure 17). When the JSF application is run, the form will appear in a browser, and when a Social Security number is entered and the button is clicked, the BPEL Process Web Service would be called and the lowest returned rate determined by the BPEL process will be displayed in the JSF form.
Summary As our example has shown, building a composite SOA application with an included JSF-based user interface is actually a straightforward process. When a tool such as Oracle JDeveloper 10g is used, it can easily be accomplished in an entirely visual manner.
Reader Feedback: Page 1 of 1
Your Feedback
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||