Jump to content

XForms/Stock Quote

From Wikibooks, open books for an open world

Motivation

[edit | edit source]

You want to have a web page that looks up a stock symbol. You have a REST-based web service that returns stock information if you pass it a ticker symbol. URL that you sends the service looks like the following:

 http://www.webservicex.net/stockquote.asmx/GetQuote?symbol=GOOG

This URL returns the following XML:

 <string>
   <StockQuotes>
     <Stock>
       <Symbol>GOOG</Symbol>
       <Last>472.63</Last>
       <Date>11/9/2006</Date>
       <Time>4:00pm</Time>
       <Change>-2.37</Change>
       <Open>476.33</Open>
       <High>479.49</High>
       <Low>471.86</Low>
       <Volume>4864589</Volume>
       <MktCap>143.8B</MktCap>
       <PreviousClose>475.00</PreviousClose>
       <PercentageChange>-0.50%</PercentageChange>
       <AnnRange>331.55 - 491.96</AnnRange>
       <Earns>7.875</Earns>
       <P-E>60.32</P-E>
       <Name>GOOGLE</Name>
     </Stock>
   </StockQuotes>
 </string>

Sample Program

[edit | edit source]

To be done

Discussion

[edit | edit source]
Next Page: Search Amazon | Previous Page: Web service
Home: XForms