Oracle’s BPEL example ‘StockQuoteService’ is not working correctly

Just for those going through the examples of Oracle BPEL that are delivered with the SOA Suite 10.1.3.1: There is a minor issue with the supplied service ‘StockQuoteService’ which is in the ‘/samples/tools’ directory and is used in some of the supplied tutorials. If you run this service, it will always return ’0.00′, for every symbol.
This is caused by the Java code that is used in the StockQuiteService.bpel file. If you view the source of this file you will see somewehere in the file the line:
String symbol = el.getNodeValue();
This always returns ‘null’ since the nodeValue of an element is ‘null’ by definition. See the javadoc of the w3c Element object. By modifying the code to:
String symbol = el.getFirstChild().getNodeValue();
you will get the expected result for an existing symbol.

tags:

About Pascal Alma

Pascal started as an Oracle Developer in 1997 and developed numerous applications with Oracle Designer/Developer and PL/SQL. Since 2001 Pascal becomes more and more active with the development of software at the Java/J2EE platform. Nowadays Pascal is a senior JEE Developer/ Architect and has a lot of experience with several open source initiatives/ frameworks especially within the Enterprise Integration area. Besides these technical skills Pascal is a big Scrum enthusiastic.

Comments are closed.