<?xml version="1.0" encoding="gb2312"?>
<rss version="2.0">
<channel>
<title><![CDATA[张宁宁]]></title>
        <image>
        <title>http://hi.baidu.com</title>
        <link>http://hi.baidu.com</link>
        <url>http://img.baidu.com/img/logo-hi.gif</url>
        </image>
<description><![CDATA[I Like Java]]></description>
<link>http://hi.baidu.com/znn1980</link>
<language>zh-cn</language>
<generator>www.baidu.com</generator>
<ttl>5</ttl>


<item>
        <title><![CDATA[实时股票数据获取方式]]></title>
        <link><![CDATA[http://hi.baidu.com/znn1980/blog/item/c5124522b74fbdae4623e871.html]]></link>
        <description><![CDATA[
		
		<font size="4"><strong>股票数据的获取目前有如下两种方法可以获取:</strong></font><br>
<br>
<font color="#ff0000">1.http/javascript接口取数据<br>
2.web-service接口</font><br>
<br>
<font size="4"><strong>1.http/javascript接口取数据</strong></font><br>
<br>
<strong>1.1Sina股票数据接口</strong><br>
以大秦铁路（股票代码：601006）为例，如果要获取它的最新行情，只需访问新浪的股票数据<br>
接口：http://hq.sinajs.cn/list=sh601006这个url会返回一串文本，例如：<br>
<br>
var hq_str_sh601006=&quot;大秦铁路, 27.55, 27.25, 26.91, 27.55, 26.20, 26.91, 26.92,<br>
22114263, 589824680, 4695, 26.91, 57590, 26.90, 14700, 26.89, 14300,<br>
26.88, 15100, 26.87, 3100, 26.92, 8900, 26.93, 14230, 26.94, 25150, 26.95, 15220, 26.96, 2008-01-11, 15:05:32&quot;;<br>
<br>
这个字符串由许多数据拼接在一起，不同含义的数据用逗号隔开了，按照程序员的思路，顺序号从0开始。<br>
0：”大秦铁路”，股票名字；<br>
1：”27.55″，今日开盘价；<br>
2：”27.25″，昨日收盘价；<br>
3：”26.91″，当前价格；<br>
4：”27.55″，今日最高价；<br>
5：”26.20″，今日最低价；<br>
6：”26.91″，竞买价，即“买一”报价；<br>
7：”26.92″，竞卖价，即“卖一”报价；<br>
8：”22114263″，成交的股票数，由于股票交易以一百股为基本单位，所以在使用时，通常把该值除以一百；<br>
9：”589824680″，成交金额，单位为“元”，为了一目了然，通常以“万元”为成交金额的单位，所以通常把该值除以一万；<br>
10：”4695″，“买一”申请4695股，即47手；<br>
11：”26.91″，“买一”报价；<br>
12：”57590″，“买二”<br>
13：”26.90″，“买二”<br>
14：”14700″，“买三”<br>
15：”26.89″，“买三”<br>
16：”14300″，“买四”<br>
17：”26.88″，“买四”<br>
18：”15100″，“买五”<br>
19：”26.87″，“买五”<br>
20：”3100″，“卖一”申报3100股，即31手；<br>
21：”26.92″，“卖一”报价<br>
(22, 23), (24, 25), (26,27), (28, 29)分别为“卖二”至“卖四的情况”<br>
30：”2008-01-11″，日期；<br>
31：”15:05:32″，时间；<br>
<br>
这个接口对于JavaScript程序非常方便，通常的使用方式为，静态或动态地在页面中插入：<br>
<br>
&lt;script type=&quot;text/javascript&quot; src=&quot;http://hq.sinajs.cn/list=sh601006&quot; charset=&quot;gb2312&quot;&gt;&lt;/script&gt;<br>
&lt;script type=&quot;text/javascript&quot;&gt;<br>
var elements=hq_str_sh601006.split(&quot;,&quot;);<br>
document.write(&quot;current price:&quot;+elements[3]);<br>
&lt;/script&gt;<br>
<br>
这段代码输出大秦铁路（股票代码：601006）的当前股价<br>
<br>
current price:14.20<br>
<br>
如果你要同时查询多个股票，那么在URL最后加上一个逗号，再加上股票代码就可以了；比如你要一次查询大秦铁路（601006）和大同煤业（601001）的行情，就这样使用URL：<br>
http://hq.sinajs.cn/list=sh601003,sh601001<br>
<br>
但如果你要查询大盘指数，情况会有不同，比如查询上证综合指数（000001），使用如下URL：<br>
http://hq.sinajs.cn/list=s_sh000001 服务器返回的数据为：<br>
<br>
var hq_str_s_sh000001=&quot;上证指数,3094.668,-128.073,-3.97,436653,5458126&quot;;<br>
<br>
数据含义分别为：指数名称，当前点数，当前价格，涨跌率，成交量（手），成交额（万元）；<br>
<br>
查询深圳成指的URL为：<br>
http://hq.sinajs.cn/list=s_sz399001<br>
<br>
<br>
<br>
对于股票的K线图，日线图等的获取可以通过请求http://image.sinajs.cn/…./…/*.gif此URL获取，其中*代表股票代码，详见如下：<br>
<br>
查看日K线图：<br>
<br>
http://image.sinajs.cn/newchart/daily/n/sh601006.gif<br>
<br>
<br>
分时线的查询：<br>
<br>
http://image.sinajs.cn/newchart/min/n/sh000001.gif<br>
<br>
日K线查询：<br>
<br>
http://image.sinajs.cn/newchart/daily/n/sh000001.gif<br>
<br>
周K线查询：<br>
<br>
http://image.sinajs.cn/newchart/weekly/n/sh000001.gif<br>
<br>
月K线查询：<br>
<br>
http://image.sinajs.cn/newchart/monthly/n/sh000001.gif<br>
<br>
<strong>1.2&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Baidu Google的财经数据</strong><br>
在baidu ,google中搜索某只股票代码时，将会在头条显示此股票的相关信息，例如在google搜索601006时，<br>
第一条搜索结果如下图：<br>
<br>
<br>
通过点击左边的图片我们发现会将此图片链接到sina财经频道上，也就是说google股票数据的获取也是从sina获取。后经抓包分析，<br>
发现google也是采用1.1中介绍的接口。<br>
<br>
Baidu的股票数据来自baidu的财经频道http://stock.baidu.com.<br>
<strong><br>
1.3&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 其他方式</strong><br>
除了sina，baidu等网站提供股票信息外，其他网站也有类似的接口。我们分析了一款论坛上采用的股票插件，<br>
其中有关于实时股票数据获取的介绍，详见如下代码，其中可以看到有些数据来自sina。<br>
<br>
&lt;%<br>
<br>
‘==========================<br>
<br>
‘ file: stock_getdata.asp<br>
<br>
‘ version: 1.0.0<br>
<br>
‘ copyright (c) czie.com all rights reserved.<br>
<br>
‘ web: http://www.czie.com<br>
<br>
‘==========================<br>
<br>
function gethttp(rurl)<br>
<br>
dim xml<br>
<br>
on error resume next<br>
<br>
set xml=server.createobject(&quot;Microsoft.XMLHTTP&quot;)<br>
<br>
xml.open &quot;get&quot;,rurl,false<br>
<br>
xml.send<br>
<br>
if not xml.readystate=4 or not xml.status=200 or err then gethttp=&quot;&quot;:exit function<br>
<br>
gethttp=xml.responsetext<br>
<br>
set xml=nothing<br>
<br>
end function<br>
<br>
function getstockdata(code)<br>
<br>
‘0=股票名称,1=开盘价格,2=昨收盘价格,3=当前价格,4=最高价,5=最低价,30,31=更新时间<br>
<br>
dim checkcode,stockdata,stockdatasplit<br>
<br>
if len(code)&lt;5 then stockdata=&quot;0,0,0,0,0,0,0,0,0,0,0,0&quot;:exit function<br>
<br>
checkcode=mid(code,len(code)-5,1)<br>
<br>
if int(checkcode)&lt;=4 then<br>
<br>
stockdata=gethttp(&quot;http://hq.sinajs.cn/list=sz&quot;&amp;code&amp;&quot;&quot;)<br>
<br>
if not len(stockdata)=0 then stockdata=split(stockdata,chr(34))(1)<br>
<br>
end if<br>
<br>
if int(checkcode)&gt;=5 then<br>
<br>
stockdata=gethttp(&quot;http://hq.sinajs.cn/list=sh&quot;&amp;code&amp;&quot;&quot;)<br>
<br>
if not len(stockdata)=0 then stockdata=split(stockdata,chr(34))(1)<br>
<br>
end if<br>
<br>
if len(stockdata)=0 then<br>
<br>
stockdata=&quot;0,0,0,0,0,0,0,0,0,0,0,0&quot;<br>
<br>
else<br>
<br>
stockdatasplit=split(stockdata,&quot;,&quot;)<br>
<br>
stockdata=&quot;&quot;&amp;exstock.checkstr(stockdatasplit(0))&amp;&quot;,&quot;&amp;stockdatasplit(1)&amp;&quot;,&quot;&amp;stockdatasplit(2)&amp;&quot;,&quot;&amp;stockdatasplit(3)&amp;&quot;,&quot;&amp;stockdatasplit(4)&amp;&quot;,&quot;&amp;stockdatasplit(5)&amp;&quot;,&quot;&amp;formatdatetime(&quot;&quot;&amp;stockdatasplit(30)&amp;&quot; &quot;&amp;stockdatasplit(31)&amp;&quot;&quot;,0)&amp;&quot;&quot;<br>
<br>
end if<br>
<br>
‘0=股票名称,1=开盘价格,2=昨收盘价格,3=当前价格,4=最高价,5=最低价,6=更新时间<br>
<br>
getstockdata=stockdata<br>
<br>
end function<br>
<br>
function getstockimg(code)<br>
<br>
dim rndnum,addnum,checkcode,imgsource<br>
<br>
if len(code)&lt;5 then exit function<br>
<br>
addnum=4<br>
<br>
randomize:rndnum=cint(rnd*addnum)<br>
<br>
select case rndnum<br>
<br>
case 0<br>
<br>
getstockimg=&quot;http://www.10jqka.com.cn/curve/kline/?code=&quot;&amp;code&amp;&quot;&quot;<br>
<br>
imgsource=&quot;http://www.10jqka.com.cn&quot;<br>
<br>
case 1<br>
<br>
getstockimg=&quot;http://stock.jrj.com.cn/htmdata/KLINE/&quot;&amp;code&amp;&quot;.png&quot;<br>
<br>
imgsource=&quot;http://stock.jrj.com.cn&quot;<br>
<br>
case 2<br>
<br>
checkcode=mid(code,len(code)-5,1)<br>
<br>
if int(checkcode)&lt;=4 then<br>
<br>
getstockimg=&quot;http://image.sinajs.cn/newchart/daily/n/sz&quot;&amp;code&amp;&quot;.gif&quot;<br>
<br>
end if<br>
<br>
if int(checkcode)&gt;=5 then<br>
<br>
getstockimg=&quot;http://image.sinajs.cn/newchart/daily/n/sh&quot;&amp;code&amp;&quot;.gif&quot;<br>
<br>
end if<br>
<br>
imgsource=&quot;http://finance.sina.com.cn&quot;<br>
<br>
case 3<br>
<br>
getstockimg=&quot;http://hq.gazxfe.com/stockchart/realline.chart?&quot;&amp;code&amp;&quot;&amp;1003&amp;SZ 500 330&quot;<br>
<br>
imgsource=&quot;http://hq.gazxfe.com&quot;<br>
<br>
case 4<br>
<br>
getstockimg=&quot;http://chartse.stockstar.com/chartserver?code=&quot;&amp;code&amp;&quot;&quot;<br>
<br>
imgsource=&quot;http://www.stockstar.com/&quot;<br>
<br>
end select<br>
<br>
getstockimg=split(&quot;&quot;&amp;getstockimg&amp;&quot;||&quot;&amp;imgsource&amp;&quot;&quot;,&quot;||&quot;)<br>
<br>
end function<br>
<br>
function getastockimg()<br>
<br>
dim rndnum,addnum,checkcode<br>
<br>
dim getastockimgb,imgsource<br>
<br>
addnum=6<br>
<br>
randomize:rndnum=cint(rnd*addnum)<br>
<br>
select case rndnum<br>
<br>
case 0<br>
<br>
getastockimg=&quot;http://202.109.106.1/gifchartse/gif/000001.gif&quot;<br>
<br>
getastockimgb=&quot;http://202.109.106.1/gifchartse/gif/399001.gif&quot;<br>
<br>
imgsource=&quot;http://www.stockstar.com/&quot;<br>
<br>
case 1<br>
<br>
getastockimg=&quot;http://money.163.com/special/100.gif?C39&quot;<br>
<br>
getastockimgb=&quot;http://money.163.com/special/101.gif?HrS&quot;<br>
<br>
imgsource=&quot;http://www.163.com&quot;<br>
<br>
case 2<br>
<br>
getastockimg=&quot;http://www.10jqka.com.cn/curve/realtime/index2.php?code=1a0001&amp;w=180&amp;h=140&quot;<br>
<br>
getastockimgb=&quot;http://www.10jqka.com.cn/curve/realtime/index2.php?code=399001&amp;w=180&amp;h=140&quot;<br>
<br>
imgsource=&quot;http://www.10jqka.com.cn&quot;<br>
<br>
case 3<br>
<br>
getastockimg=&quot;http://chart.cnlist.com/stockchart/realline.chart?1a0001&amp;1002&amp;SZ 180 140&quot;<br>
<br>
getastockimgb=&quot;http://chart.cnlist.com/stockchart/realline.chart?399001&amp;1002&amp;SZ 180 140&quot;<br>
<br>
imgsource=&quot;http://chart.cnlist.com/&quot;<br>
<br>
case 4<br>
<br>
getastockimg=&quot;http://image.sinajs.cn/newchart/small/ish000001.gif?1189176558328&quot;<br>
<br>
getastockimgb=&quot;http://image.sinajs.cn/newchart/small/isz399001.gif?1189176558328&quot;<br>
<br>
imgsource=&quot;http://www.sinajs.cn&quot;<br>
<br>
case 5<br>
<br>
getastockimg=&quot;http://218.1.72.66/cgi/pic/sh/realtime/JA000001164143.png&quot;<br>
<br>
getastockimgb=&quot;http://218.1.72.66/cgi/pic/sz/realtime/JA399001164143.png&quot;<br>
<br>
imgsource=&quot;http://www.cnstock.com/&quot;<br>
<br>
case 6<br>
<br>
getastockimg=&quot;http://222.73.29.85/img/000001.png&quot;<br>
<br>
getastockimgb=&quot;http://222.73.29.85/img/399001.png&quot;<br>
<br>
imgsource=&quot;http://www.eastmoney.com/&quot;<br>
<br>
end select<br>
<br>
getastockimg=split(&quot;&quot;&amp;getastockimg&amp;&quot;||&quot;&amp;getastockimgb&amp;&quot;||&quot;&amp;imgsource&amp;&quot;&quot;,&quot;||&quot;)<br>
<br>
end function<br>
<br>
%&gt;<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<font size="4"><strong><br>
2.&#160;&#160; web-service接口</strong></font><br>
<br>
<strong>2.1&#160; CHINAstock的web-service：</strong><br>
http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx<br>
<br>
中国股票行情数据 WEB 服务（支持深圳和上海股市的全部基金、债券和股票），数据即时更新。输出GIF分时走势图、日/周/月 K 线图、及时行情数据（股票名称、行情时间、最新价、昨收盘、今开盘、涨跌额、最低、最高、涨跌幅、成交量、成交额、竞买价、竞卖价、委比、买一 - 买五、卖一 - 卖五）。此WEB服务提供了如下几个接口：<br>
<br>
<strong>2.1.1&#160; getStockImageByCode</strong><br>
GET 股票GIF分时走势图<br>
<br>
INput：theStockCode = 股票代号，如：sh000001<br>
<br>
POST /WebServices/ChinaStockWebService.asmx HTTP/1.1<br>
<br>
Host: www.webxml.com.cn<br>
<br>
Content-Type: text/xml; charset=utf-8<br>
<br>
Content-Length: length<br>
<br>
SOAPAction: &quot;http://WebXml.com.cn/getStockImageByCode&quot;<br>
<br>
<br>
<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>
<br>
&lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;<br>
<br>
&lt;soap:Body&gt;<br>
<br>
&lt;getStockImageByCode xmlns=&quot;http://WebXml.com.cn/&quot;&gt;<br>
<br>
&lt;theStockCode&gt;string&lt;/theStockCode&gt;<br>
<br>
&lt;/getStockImageByCode&gt;<br>
<br>
&lt;/soap:Body&gt;<br>
<br>
&lt;/soap:Envelope&gt;<br>
<br>
Output：<br>
<br>
<br>
<strong>2.1.2 getStockImageByteByCode</strong><br>
获得中国股票GIF分时走势图字节数组<br>
<br>
INput：theStockCode = 股票代号，如：sh000001<br>
<br>
POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: &quot;http://WebXml.com.cn/getStockImageByteByCode&quot; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&#160; &lt;soap:Body&gt;&#160;&#160;&#160; &lt;getStockImageByteByCode xmlns=&quot;http://WebXml.com.cn/&quot;&gt;&#160;&#160;&#160;&#160;&#160; &lt;theStockCode&gt;string&lt;/theStockCode&gt;&#160;&#160;&#160; &lt;/getStockImageByteByCode&gt;&#160; &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;<br>
<br>
返回的数据如下：<br>
<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;<br>
<br>
&lt;base64Binary xmlns=&quot;http://WebXml.com.cn/&quot;&gt;R0lGODlhIQIsAfcAAAAAAAwLBxkGBQ4ODhAQEBsSChUVFS4TDB8eGQkA9koPCDAAzy4mFVgAp2UYC0IqEUYuBVwiDEAsI1QnFX8AgDU1NUozFlgxD6cBWVY5FnIwEmQ4Gc0AMlhDHPEADlVJMEpKSm1IHOUBWpY3FZMyVY9IGXRWIEFmWGNYUmpdPXJgHQB8HK9EGGBgX4lXIACoAHhkMyt4m4VkJtstbv8A<br>
<br>
<strong>2.1.3&#160; getStockImage_kByCode</strong><br>
直接获得中国股票GIF日/周/月 K 线图（545*300pixel/72dpi）<br>
INPUT: theStockCode = 股票代号<br>
<br>
theType = K 线图类型（D：日[默认]、W：周、M：月），<br>
<br>
POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: &quot;http://WebXml.com.cn/getStockImage_kByCode&quot; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&#160; &lt;soap:Body&gt;&#160;&#160;&#160; &lt;getStockImage_kByCode xmlns=&quot;http://WebXml.com.cn/&quot;&gt;&#160;&#160;&#160;&#160;&#160; &lt;theStockCode&gt;string&lt;/theStockCode&gt;&#160;&#160;&#160;&#160;&#160; &lt;theType&gt;string&lt;/theType&gt;&#160;&#160;&#160; &lt;/getStockImage_kByCode&gt;&#160; &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;<br>
<br>
比如按照下图所示输入：<br>
<br>
<br>
返回的结果就是周K线图：<br>
<br>
<br>
<strong>2.1.4&#160; getStockImage_kByteByCode</strong><br>
获得中国股票GIF日/周/月 K 线图字节数组<br>
<br>
Input：theStockCode = 股票代号，如：sh000001<br>
<br>
POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: &quot;http://WebXml.com.cn/getStockImage_kByteByCode&quot; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&#160; &lt;soap:Body&gt;&#160;&#160;&#160; &lt;getStockImage_kByteByCode xmlns=&quot;http://WebXml.com.cn/&quot;&gt;&#160;&#160;&#160;&#160;&#160; &lt;theStockCode&gt;string&lt;/theStockCode&gt;&#160;&#160;&#160;&#160;&#160; &lt;theType&gt;string&lt;/theType&gt;&#160;&#160;&#160; &lt;/getStockImage_kByteByCode&gt;&#160; &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;HTTP/1.1 200 OKContent-Type: text/xml; charset=utf-8Content-Length: length &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&#160; &lt;soap:Body&gt;&#160;&#160;&#160; &lt;getStockImage_kByteByCodeResponse xmlns=&quot;http://WebXml.com.cn/&quot;&gt;&#160;&#160;&#160;&#160;&#160; &lt;getStockImage_kByteByCodeResult&gt;base64Binary&lt;/getStockImage_kByteByCodeResult&gt;&#160;&#160;&#160; &lt;/getStockImage_kByteByCodeResponse&gt;&#160; &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;比如按照下图输入<br>
<br>
：<br>
<br>
返回的结果就是周K线图字节数组<br>
<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;<br>
<br>
&lt;base64Binary xmlns=&quot;http://WebXml.com.cn/&quot;&gt;R0lGODlhIQIsAfcAAAAAAAwLBxkGBQ4ODhAQEBsSChUVFS4TDB8eGQkA9koPCDAAzy4mFVgAp2UYC0IqEUYuBVwiDEAsI1QnFX8AgDU1NUozFlgxD6cBWVY5FnIwEmQ4Gc0AMlhDHPEADlVJMEpKSm1IHOUBWpY3FZMyVY9IGXRWIEFmWGNYUmpdPXJgHQB8HK9EGGBgX4lXIACoAHhkMyt4m4VkJtstbv8A<br>
<br>
<br>
<br>
<strong>2.1.5&#160; getStockInfoByCode</strong><br>
获得中国股票及时行情<br>
input：theStockCode = 股票代号<br>
<br>
POST /WebServices/ChinaStockWebService.asmx HTTP/1.1Host: www.webxml.com.cnContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: &quot;http://WebXml.com.cn/getStockInfoByCode&quot; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;soap:Envelope xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&#160; &lt;soap:Body&gt;&#160;&#160;&#160; &lt;getStockInfoByCode xmlns=&quot;http://WebXml.com.cn/&quot;&gt;&#160;&#160;&#160;&#160;&#160; &lt;theStockCode&gt;string&lt;/theStockCode&gt;&#160;&#160;&#160; &lt;/getStockInfoByCode&gt;&#160; &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;返回的值一个一维字符串数组 String(24)，结构为：String(0)股票代号、String(1)股票名称、String(2)行情时间、String(3)最新价（元）、String(4)昨收盘（元）、String(5)今开盘（元）、String(6)涨跌额（元）、String(7)最低（元）、 String(8)最高（元）、String(9)涨跌幅（%）、String(10)成交量（手）、String(11)成交额（万元）、 String(12)竞买价（元）、String(13)竞卖价（元）、String(14)委比（%）、String(15)-String(19)买一 - 买五（元）/手、String(20)-String(24)卖一 - 卖五（元）/手。<br>
<br>
<br>
<br>
Web service的方法类似于现在concurrent项目的DBWS数据的获取，都是通过SOAP协议向DBWS服务器获取相关的数据。<br>
<br>
<br>
<br>
<br>
利用雅虎查中国股票<br>
<br>
http://quote.yahoo.com/d/quotes.csv?s=MSFT&amp;f=slc1wop<br>
返回微软的股票价格<br>
<br>
&quot;MSFT&quot;,&quot;4:00pm - &lt;b&gt;30.70&lt;/b&gt;&quot;,+1.04,&quot;21.46 - 30.75&quot;,29.77,29.66<br>
http://quote.yahoo.com/d/quotes.csv?s=000969.SZ&amp;f=slc1wop<br>
这个返回安泰科技的，一般有半个小时的延迟。<br>
<br>
但是s=000969.sz 这个后面的sz是什么意思呢？<br>
深圳:)<br>
沪市是SS后缀 <a href="http://hi.baidu.com/znn1980/blog/item/c5124522b74fbdae4623e871.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/znn1980/blog/category/%B9%A4%D7%F7%C8%D5%D6%BE">工作日志</a>&nbsp;<a href="http://hi.baidu.com/znn1980/blog/item/c5124522b74fbdae4623e871.html#comment">查看评论</a>]]></description>
        <pubDate>2009年11月08日 星期日  下午 08:09</pubDate>
        <category><![CDATA[工作日志]]></category>
        <author><![CDATA[znn1980]]></author>
		<guid>http://hi.baidu.com/znn1980/blog/item/c5124522b74fbdae4623e871.html</guid>
</item>

<item>
        <title><![CDATA[jadeclipse]]></title>
        <link><![CDATA[http://hi.baidu.com/znn1980/blog/item/380d4363f565cb690c33fa2b.html]]></link>
        <description><![CDATA[
		
		<font size="5"><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span><span style="font-size: 10pt;"><span><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="color: rgb(0, 0, 0);"><span style="font-size: 10pt;"><span><span style="font-size: 10pt;"><span><font size="4">jad -o -r -s java -d src **/*.class<br>
<br>
-o：覆盖旧文件，而且不用提示确认。<br>
-r：重新加载生成包结构。<br>
-s：定义输出文件的扩展名。jad为默认扩展名，我们反编译后当然是要.java源文件了。<br>
-d：输出文件的目录。src表示反编译后的所有文件都放在src目录下。</font><br>
</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></font> <a href="http://hi.baidu.com/znn1980/blog/item/380d4363f565cb690c33fa2b.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/znn1980/blog/category/Java">Java</a>&nbsp;<a href="http://hi.baidu.com/znn1980/blog/item/380d4363f565cb690c33fa2b.html#comment">查看评论</a>]]></description>
        <pubDate>2009年08月08日 星期六  上午 08:53</pubDate>
        <category><![CDATA[Java]]></category>
        <author><![CDATA[znn1980]]></author>
		<guid>http://hi.baidu.com/znn1980/blog/item/380d4363f565cb690c33fa2b.html</guid>
</item>

<item>
        <title><![CDATA[vi/vim 快捷键盘对照图]]></title>
        <link><![CDATA[http://hi.baidu.com/znn1980/blog/item/8ad3b9233e14bf4dad34deb3.html]]></link>
        <description><![CDATA[
		
		<div forimg="1">
<div forimg="1">
<div forimg="1"><img border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/3518af015439fcf0277fb5ba.jpg" small="0" class="blogimg">
<div forimg="1"><img border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/328ba454e1548b393a293581.jpg" small="0" class="blogimg"></div>
</div>
</div>
</div> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/znn1980/blog/category/Linux">Linux</a>&nbsp;<a href="http://hi.baidu.com/znn1980/blog/item/8ad3b9233e14bf4dad34deb3.html#comment">查看评论</a>]]></description>
        <pubDate>2009年06月24日 星期三  下午 05:27</pubDate>
        <category><![CDATA[Linux]]></category>
        <author><![CDATA[znn1980]]></author>
		<guid>http://hi.baidu.com/znn1980/blog/item/8ad3b9233e14bf4dad34deb3.html</guid>
</item>

<item>
        <title><![CDATA[端午南娱（南戴河国际娱乐中心）之行]]></title>
        <link><![CDATA[http://hi.baidu.com/znn1980/blog/item/570d9bdebc0e3250ccbf1afd.html]]></link>
        <description><![CDATA[
		
		<div forimg="1">上飞机<br>
<img width="620" height="463" border="0" class="blogimg" small="1" src="http://hiphotos.baidu.com/znn1980/pic/item/f48f6f104887fbd9c3ce79db.jpg"><br>
飞机之上<br>
<div forimg="1"><img width="619" height="462" border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/cc94de035c2f9a523912bba8.jpg" small="1" class="blogimg"></div>
<br>
座驾<br>
<div forimg="1"><img width="621" height="465" border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/048f8e1e7374ce3a413417b5.jpg" small="1" class="blogimg"></div>
<br>
秦皇岛码头<br>
<div forimg="1"><img width="623" height="467" border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/e4d4df03c62393c908fa93b2.jpg" small="1" class="blogimg"></div>
<br>
参观<br>
<div forimg="1">
<div forimg="1"><a target="_blank" href="http://hiphotos.baidu.com/znn1980/pic/item/ca0c4606542f395e02088180.jpg">
<div forimg="1"><img width="615" height="461" border="0" class="blogimg" small="1" src="http://hiphotos.baidu.com/znn1980/pic/item/ca0c4606542f395e02088180.jpg"></div>
</a></div>
</div>
<br>
中心<br>
<div forimg="1"><img width="617" height="462" border="0" class="blogimg" small="1" src="http://hiphotos.baidu.com/znn1980/pic/item/8cd54ad9bd6f640911df9b82.jpg"></div>
<br>
驻地<br>
<div forimg="1"><img width="615" height="461" border="0" class="blogimg" small="1" src="http://hiphotos.baidu.com/znn1980/pic/item/e4dddad3079722faa9ec9a81.jpg"></div>
<div forimg="1"><img width="615" height="461" border="0" class="blogimg" small="1" src="http://hiphotos.baidu.com/znn1980/pic/item/56a624f4aa16f8ca7609d781.jpg"><br>
南娱<br>
<div forimg="1"><img width="614" height="460" border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/74d77f2c40349ac98b139971.jpg" small="1" class="blogimg"></div>
<div forimg="1"><img width="633" height="474" border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/1d5467c27a89b610e4dd3b71.jpg" small="1" class="blogimg"></div>
<div forimg="1"><img width="617" height="462" border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/178b88ec5116621827979172.jpg" small="1" class="blogimg"></div>
<div forimg="1"><img width="624" height="467" border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/810c00385cddda01b9998f73.jpg" small="1" class="blogimg"></div>
<div forimg="1"><img width="610" height="457" border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/4e91f943b8a5e23672f05d73.jpg" small="1" class="blogimg"></div>
<br>
农业园<br>
<div forimg="1"><img width="611" height="458" border="0" src="http://hiphotos.baidu.com/znn1980/pic/item/048f8e1e733dce3a4034177c.jpg" small="1" class="blogimg"></div>
</div>
</div> <a href="http://hi.baidu.com/znn1980/blog/item/570d9bdebc0e3250ccbf1afd.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/znn1980/blog/category/%D0%C4%C7%E9">心情</a>&nbsp;<a href="http://hi.baidu.com/znn1980/blog/item/570d9bdebc0e3250ccbf1afd.html#comment">查看评论</a>]]></description>
        <pubDate>2009年06月02日 星期二  上午 08:50</pubDate>
        <category><![CDATA[心情]]></category>
        <author><![CDATA[znn1980]]></author>
		<guid>http://hi.baidu.com/znn1980/blog/item/570d9bdebc0e3250ccbf1afd.html</guid>
</item>

<item>
        <title><![CDATA[AIX下的压缩命令]]></title>
        <link><![CDATA[http://hi.baidu.com/znn1980/blog/item/2ed7d51f13f42902304e15a9.html]]></link>
        <description><![CDATA[
		
		<span >
<h4 class="beTitle">AIX下的压缩命令</h4>
<div class="bvMsg" >
<p>1. backup: 加-i参数可对文件或目录进行备份，加-p参数可对要备份的文件进行压缩，但是仅能压缩小于2G的文件。<br>
2. compress: 对文件进行压缩，并将源文件替换成.Z文件。<br>
3. gzip:对文件进行压缩，并将源文件替换成.gz文件。<br>
4. tar 对文件进行归档操作，没有压缩。<br>
用不同的命令对一个大小为16621047byte 的test.txt 文件进行压缩对比测试<br>
命令&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  压缩后文件名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  文件大小&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  压缩率<br>
tar -cvf test.tar test.txt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  test.tar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  16629760&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  0 ％<br>
ls test.txt | backup -ivpf test.bak&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  test.bak&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  6912000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  58 %<br>
compress -v test.txt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  test.txt.Z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  1209517&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  93 %<br>
gzip test.txt -v test.txt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  test.txt.gz&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  819208&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  95 %</p>
</div>
</span> <a href="http://hi.baidu.com/znn1980/blog/item/2ed7d51f13f42902304e15a9.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/znn1980/blog/category/%B9%A4%D7%F7%C8%D5%D6%BE">工作日志</a>&nbsp;<a href="http://hi.baidu.com/znn1980/blog/item/2ed7d51f13f42902304e15a9.html#comment">查看评论</a>]]></description>
        <pubDate>2009年05月18日 星期一  下午 04:12</pubDate>
        <category><![CDATA[工作日志]]></category>
        <author><![CDATA[znn1980]]></author>
		<guid>http://hi.baidu.com/znn1980/blog/item/2ed7d51f13f42902304e15a9.html</guid>
</item>


</channel>
</rss>