2008年1月12日土曜日

クリック証券Local APL ServerをUbuntuへインストール

pythonで書かれているのでpython2.5が入っているか確認。
$ python
Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32)

クリック証券からアプリをダウンロードし解凍する
解凍したモジュールをインストール。

CLICK-SEC_LocalAPIServer_2.4.0/CherryPy-2.2.1ディレクトリへ移動
$ sudo python setup.py install

CLICK-SEC_LocalAPIServer_2.4.0/CherryTemplate-1.0.0ディレクトリへ移動
$ sudo python setup.py install

※ 解凍したディレクトリにあるinstall.shではうまくいかなかった。

サーバ起動
$ python LocalAPIServer.py
/usr/lib/python2.5/site-packages/cherrypy/lib/profiler.py:54: UserWarning: Your installation of Python doesn't have a profile module. If you're on Debian, you can apt-get python2.4-profiler from non-free in a separate step. See http://www.cherrypy.org/wiki/ProfilingOnDebian for details.
warnings.warn(msg)
/usr/lib/python2.5/site-packages/cherrypy/lib/profiler.py:54: UserWarning: Your installation of Python doesn't have a profile module. If you're on Debian, you can apt-get python2.4-profiler from non-free in a separate step. See http://www.cherrypy.org/wiki/ProfilingOnDebian for details.
warnings.warn(msg)
12/Jan/2008:14:47:35 CONFIG INFO Server parameters:
12/Jan/2008:14:47:35 CONFIG INFO server.environment: development
12/Jan/2008:14:47:35 CONFIG INFO server.log_to_screen: True
12/Jan/2008:14:47:35 CONFIG INFO server.log_file: demoserver.log
12/Jan/2008:14:47:35 CONFIG INFO server.log_tracebacks: True
12/Jan/2008:14:47:35 CONFIG INFO server.log_request_headers: True
12/Jan/2008:14:47:35 CONFIG INFO server.protocol_version: HTTP/1.0
12/Jan/2008:14:47:35 CONFIG INFO server.socket_host: localhost
12/Jan/2008:14:47:35 CONFIG INFO server.socket_port: 8000
12/Jan/2008:14:47:35 CONFIG INFO server.socket_file:
12/Jan/2008:14:47:35 CONFIG INFO server.reverse_dns: False
12/Jan/2008:14:47:35 CONFIG INFO server.socket_queue_size: 5
12/Jan/2008:14:47:35 CONFIG INFO server.thread_pool: 5
12/Jan/2008:14:47:36 HTTP INFO Serving HTTP on http://localhost:8000/

エラーがでるのでpython-profilerを入れる
sudo aptitude install python-profiler

$ python LocalAPIServer.py
12/Jan/2008:18:48:55 CONFIG INFO Server parameters:
12/Jan/2008:18:48:55 CONFIG INFO server.environment: development
12/Jan/2008:18:48:55 CONFIG INFO server.log_to_screen: True
12/Jan/2008:18:48:55 CONFIG INFO server.log_file: demoserver.log
12/Jan/2008:18:48:55 CONFIG INFO server.log_tracebacks: True
12/Jan/2008:18:48:55 CONFIG INFO server.log_request_headers: True
12/Jan/2008:18:48:55 CONFIG INFO server.protocol_version: HTTP/1.0
12/Jan/2008:18:48:55 CONFIG INFO server.socket_host: localhost
12/Jan/2008:18:48:55 CONFIG INFO server.socket_port: 8000
12/Jan/2008:18:48:55 CONFIG INFO server.socket_file:
12/Jan/2008:18:48:55 CONFIG INFO server.reverse_dns: False
12/Jan/2008:18:48:55 CONFIG INFO server.socket_queue_size: 5
12/Jan/2008:18:48:55 CONFIG INFO server.thread_pool: 5
12/Jan/2008:18:48:55 HTTP INFO Serving HTTP on http://localhost:8000/

起動成功

簡単なクライアントでアクセスしXMLのレスポンスを取得した
<?xml version="1.0" encoding="UTF-8" ?>
<messageListResponse>
<responseStatus>OK</responseStatus>
<messageList>
<messageListItem>
<riyo>0</riyo>
<taishosha>1</taishosha>
<title>2007年05月18日(金)お知らせ内容のタイトル</title>
<text>お知らせ内容の本文です。</text>
</messageListItem>
</messageList>
<message>お知らせ一覧の取得が完了しました。</message>
</messageListResponse>

0 件のコメント:

干し芋のリスト