public org.apache.axiom.om.OMElement getStockQuote(org.apache.axiom.om.OMElement param0) throws AxisFault {
StAXSource staxSource =
new StAXSource(param0.getXMLStreamReader());
Unmarshaller unmarshaller = new Unmarshaller(GetStockQuote.class);
UnmarshalHandler unmarshalHandler = unmarshaller.createHandler();
GetStockQuote stockQuote;
try {
ContentHandler contentHandler = Unmarshaller.getContentHandler(unmarshalHandler);
TransformerFactory.newInstance().newTransformer().transform(staxSource, new SAXResult(contentHandler));
stockQuote = (GetStockQuote) unmarshalHandler.getObject();
} catch (SAXException e) {
throw new RuntimeException(e);
} catch (TransformerException e) {
throw new RuntimeException(e);
}
if (!stockQuote.getSymbol().equals("IBM")) {
throw new AxisFault("StockQuote details for the symbol '"+ stockQuote.getSymbol() + "' are not available.");
}
GetStockQuoteResponse stockQuoteResponse = new GetStockQuoteResponse();
Quote quote = new Quote();
quote.setSymbol(stockQuote.getSymbol());
quote.setVolume(5000);
LastTrade lastTrade = new LastTrade();
lastTrade.setPrice(99);
lastTrade.setDate(Calendar.getInstance().getTimeInMillis());