Comments
litl_phil wrote: While it's nice that Google and Acer share the vision of cloud-based computing, it's also worth noting that we at litl already have a webbook on the market (available at litl.com) that runs our own cloud-based OS. Unlike Chrome, litlOS is focused on creating a new and better web experience for the home, so we don't have the usual browser interface, we have our own innovative UI. In conjunction with easel mode (litl's inverted-V position) and our growing cohort of litl channels (special apps t...
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


Java Feature: Putting a Face on Web Services and SOA
It's easier than you think

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) {
       try {
       proxy.CheaploansWSSoapHttpPortClient myPort = new
proxy.CheaploansWSSoapHttpPortClient();
       System.out.println("calling " + myPort.getEndpoint());
      // Add your own code here
       } catch (Exception ex) {
         ex.printStackTrace();
      }
     }

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() {
     // Call BPEL Web service through Proxy Class
     float returnedRate = 0;
     try {
       proxy.CheaploansWSSoapHttpPortClient myPort = new proxy.CheaploansWSSoapHttpPortClient();
       returnedRate = myPort.invokeCompareLoan((String)inputText1.getValue());
     }
     catch (Exception e) {
       e.printStackTrace();
     };
     // Display the returned value in the outputText field.
     outputText1.setValue(returnedRate);

     return "Success";
}

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
With SOA comes the unique possibility to easily couple vastly different sets of services together into single, cohesive business service. When accompanied with a JSF-based user interface, a BPEL process can then offer its services through a rich user interface.

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.

About Chris Schalk
Chris Schalk is a Tech Lead in the Developer API Evangelism group at Google. He is also one of the original members of the OpenAjax Alliance. Prior to Google, Chris was a Principal Product Manager and Java Evangelist for Oracle's application server and development tools division. While at Oracle, he worked to define the overall web development experience for Oracle JDeveloper and ADF Faces (Trinidad). He is also the co-author of JavaServer Faces: The Complete Reference published through McGraw-Hill Osborne (ISBN: 0072262400) and maintains a popular Blog on J2EE Web development at www.jroller.com/page/cschalk.

About Michael O'Neill
Michael O'Neill is manager of developer programs at Oracle, with six years of experience in Web and UI development utilizing both Java and Microsoft technologies.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Hi,

I have attempted to use the example (http://java.sys-con.com/read/192427.htm)with JDeveloper 10.1.3, and
I keep running into the same error when I compile the BPEL, it complains regarding
the "soc_security" global variable - "make sure variable with messageType definition is used" this
is just a local variable to pass a value around?

Any comments/suggestions regarding how I can fix this issue would be most appreciated.

Details from JDeveloper below.

Error(84):
[Error ORABPEL-10032]: missing messageType
[Description]: in line 84 of "C:\002_DEV\loanMark1\loanMark1\bpel\loanMark1.bpel",
variable "soc_security" of invoke does not have a messageType definition..
[Potential fix]: make sure variable with messageType definition is used in incoming
and outgoing activities.

Error(84):
[Error ORABPEL-10032]: missing messageType
[Description]: in line 84 of "C:\002_DEV\loanMark1\loanMark1\bpel\loanMark1.bpel",
variable "soc_security" of invoke does not have a messageType definition..
[Potential fix]: make sure variable with messageType definition is used in incoming and outgoing activities.

Thank you

Guys,

I enjoyed your piece entitled "Putting a Face on Web Services and SOA". With regard to BPEL, you really should check out Active Endpoints. We offer a world-class, Eclipse based BPEL designer FOR FREE, and servers that range from our open source ActiveBPEL Engine all the way up to enterprise class BPEL solutions for popular J2EE containers.

Readers who want to download the free ActiveBPEL Designer can do so at http://www.active-endpoints.com/products/activebpeldes/index.html. Readers who need access to commercial grade open source BPEL engine can visit http://www.activebpel.org.

Fred

Service-Oriented Architecture (SOA) is a hot topic among analysts, CIOs, and technology marketers, but the path from high-level architectural principles to programming a functioning, real-world service isn't always clear, especially since, in the end, you still need to create a clean user interface that's as flexible as the services it consumes.


Your Feedback
Mark wrote: Hi, I have attempted to use the example (http://java.sys-con.com/read/192427.htm)with JDeveloper 10.1.3, and I keep running into the same error when I compile the BPEL, it complains regarding the "soc_security" global variable - "make sure variable with messageType definition is used" this is just a local variable to pass a value around? Any comments/suggestions regarding how I can fix this issue would be most appreciated. Details from JDeveloper below. Error(84): [Error ORABPEL-10032]: missing messageType [Description]: in line 84 of "C:\002_DEV\loanMark1\loanMark1\bpel\loanMark1.bpel", variable "soc_security" of invoke does not have a messageType definition.. [Potential fix]: make sure variable with messageType definition is used in incoming and outgoing activities. Error(84): [Error ORABPEL-10032]: missing messageType [Description]: in line 84 of "C:...
Fred Holahan wrote: Guys, I enjoyed your piece entitled "Putting a Face on Web Services and SOA". With regard to BPEL, you really should check out Active Endpoints. We offer a world-class, Eclipse based BPEL designer FOR FREE, and servers that range from our open source ActiveBPEL Engine all the way up to enterprise class BPEL solutions for popular J2EE containers. Readers who want to download the free ActiveBPEL Designer can do so at http://www.active-endpoints.com/products/activebpeldes/index.html. Readers who need access to commercial grade open source BPEL engine can visit http://www.activebpel.org. Fred
SYS-CON Italy News Desk wrote: Service-Oriented Architecture (SOA) is a hot topic among analysts, CIOs, and technology marketers, but the path from high-level architectural principles to programming a functioning, real-world service isn't always clear, especially since, in the end, you still need to create a clean user interface that's as flexible as the services it consumes.
Enterprise Open Source Magazine Latest Stories . . .
Oracle seems to have divided the open source ranks over the MySQL delay it’s having closing its acquisition of Sun. Eben Moglin, the GPL’s most ardent defender and delineator, the lawyer who has worked hand in glove for years with the Free Software Foundation’s founder Richard Stallman...
Cloud computing is a game changer. The cloud is disrupting traditional software and hardware business models by disrupting how IT service gets delivered. Entrepreneurial opportunities abound as this classic disruptive technology begins to proliferate, so it is no surprise that SYS-CON'...
The irony is that Oracle has advanced MySQL, lost money in the process, and helped its competitors - all at the same time. When Oracle buys Sun and controls MySQL the gift (other than to Microsoft SQL Server) keeps on giving as the existential threat to RDBs is managed by Redwood Shore...
WSO2, the open source SOA company, today announced the launch of the WSO2 Cloud Platform. Available today, the new WSO2 Cloud Platform features a family of WSO2 Cloud Virtual Machines; WSO2 Cloud Connectors for enabling fast, secure cloud services; and the multi-tenant WSO2 Governance-...
Now, the open source Mozilla Thunderbird client software can be used with Open-Xchange collaboration software. The "Community OXtender for Thunderbird" software connector gives users full access to appointments and contacts stored in the Open-Xchange Server and enables them to use Thun...
Morph Labs, a leading provider of enterprise cloud computing technology, today announced an introductory trial of the Morph CloudServer, an open, standards-based server IT organizations can use to rapidly model and evaluate their cloud implementations. A miniature "Cloud Environment in...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE