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.

About Pascal Alma

Pascal is a senior IT consultant and has been working in IT since 1997. He is monitoring the latest development in new technologies (Mobile, Cloud, Big Data) closely and particularly interested in Java open source tool stacks, cloud related technologies like AWS and mobile development like building iOS apps with Swift. Specialties: Java/JEE/Spring Amazon AWS API/REST Big Data Continuous Delivery Swift/iOS
This entry was posted in BPEL and tagged . Bookmark the permalink.