Package samples.databinding.data

Examples of samples.databinding.data.GetStockQuote


    public org.apache.axiom.om.OMElement getStockQuote(org.apache.axiom.om.OMElement param0) {
        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);
        }
        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());
View Full Code Here


        System.out.println("Getting Stock Quote for " + symbol);

        StockQuoteServiceStub stub =
                new StockQuoteServiceStub(url);
        stub._getServiceClient().getOptions().setAction("getStockQuote");
        GetStockQuote stockQuote = new GetStockQuote();
        stockQuote.setSymbol(symbol);
        SAXOMBuilder builder = new SAXOMBuilder();
        Marshaller.marshal(stockQuote, builder);
        OMElement response = stub.getStockQuote(
                builder.getRootElement());
View Full Code Here

    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());
View Full Code Here

    public org.apache.axiom.om.OMElement getStockQuote(org.apache.axiom.om.OMElement param0) {
        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);
        }
        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());
View Full Code Here

        System.out.println("Getting Stock Quote for " + symbol);

        StockQuoteServiceStub stub =
                new StockQuoteServiceStub(url);
        stub._getServiceClient().getOptions().setAction("getStockQuote");
        GetStockQuote stockQuote = new GetStockQuote();
        stockQuote.setSymbol(symbol);
        SAXOMBuilder builder = new SAXOMBuilder();
        Marshaller.marshal(stockQuote, builder);
        OMElement response = stub.getStockQuote(
                builder.getRootElement());
View Full Code Here

     * @param param0
     */
    public OMElement getStockQuote(OMElement param0) throws AxisFault {
        Unmarshaller unmarshaller = new Unmarshaller(GetStockQuote.class);
        UnmarshalHandler unmarshalHandler = unmarshaller.createHandler();
        GetStockQuote stockQuote;
        try {
            ContentHandler contentHandler = Unmarshaller.getContentHandler(unmarshalHandler);
            TransformerFactory.newInstance().newTransformer().transform(param0.getSAXSource(false), 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());
View Full Code Here

        System.out.println("Getting Stock Quote for " + symbol);

        StockQuoteServiceStub stub =
                new StockQuoteServiceStub(url);
        stub._getServiceClient().getOptions().setAction("getStockQuote");
        GetStockQuote stockQuote = new GetStockQuote();
        stockQuote.setSymbol(symbol);
        OMDocument document = OMAbstractFactory.getOMFactory().createOMDocument();
        Marshaller.marshal(stockQuote, document.getSAXResult().getHandler());
        OMElement response = stub.getStockQuote(
                document.getOMDocumentElement());
View Full Code Here

TOP

Related Classes of samples.databinding.data.GetStockQuote

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.