spacer
Yehuda Shiran April 1, 2002
The Web Service XML Response
Tips: April 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Web services respond in XML. The StockQuote Web service responds with 16 different data elements for each trade symbol. Each data item is enclosed within a separate tag. For example, the <High> tag includes the high value of the symbol during the current trading session:

  <High>64.70</High>
The market capitalization is denoted by the <MktCap> tag. Notice that the data includes the units of measures (B for Billions):

  <MktCap>346.3B</MktCap>
Here is an example listing of the XML response for the symbols YHOO, IBM, and MSFT:

  <StockQuotes>
    <Stock>
      <Symbol>YHOO</Symbol>
	  <Last>18.93</Last>
	  <Date>3/8/2002</Date>
	  <Time>4:00pm</Time>
	  <Change>+0.99</Change>
	  <Open>18.44</Open>
	  <High>18.98</High>
	  <Low>18.05</Low>
	  <Volume>9506500</Volume>
	  <MktCap>11.006B</MktCap>
	  <PrevClose>17.94</PrevClose>
	  <pctChg>+5.52%</PctChg>
	  <AnnRange>8.02 - 24.4375</AnnRange>
	  <Earns>0.07</Earns>
	  <P-E>256.29</P-E>
	  <Name>YAHOO INC</Name>
    </Stock>
    <Stock>
      <Symbol>IBM</Symbol>
	  <Last>105.09</Last>
	  <Date>3/8/2002</Date>
	  <Time>4:02pm</Time>
  	  <Change>+1.38</Change>
	  <Open>104.82</Open>
	  <High>107.34</High>
	  <Low>104.82</Low>
	  <Volume>10708000</Volume>
	  <MktCap>181.0B</MktCap>
	  <PrevClose>103.71</PrevClose>
	  <pctChg>+1.33%</PctChg>
	  <AnnRange>87.49 - 126.39</AnnRange>
	  <Earns>4.35</Earns>
	  <P-E>23.84</P-E>
	  <Name>INTL BUS MACHINE</Name>
    </Stock>
    <Stock>
      <Symbol>MSFT</Symbol>
	  <Last>63.95</Last>
	  <Date>3/8/2002</Date>
	  <Time>4:01pm</Time>
	  <Change>+1.23</Change>
	  <Open>63.63</Open>
	  <High>64.70</High>
	  <Low>63.17</Low>
	  <Volume>28780100</Volume>
	  <MktCap>346.3B</MktCap>
	  <PrevClose>62.72</PrevClose>
	  <pctChg>+1.96%</PctChg>
	  <AnnRange>47.50 - 76.15</AnnRange>
	  <Earns>1.09</Earns>
	  <P-E>57.54</P-E>
	  <Name>MICROSOFT CP  </Name>
    </Stock>
  </StockQuotes>
Learn more about consuming the StockQuote Web service from Column 105, Web Services, Part X: Consuming the StockQuote.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business