Here is the tutorial of H-InvDB Web service.
H-InvDB Web service provide the various APIs to use H-InvDB data.
Any one can use the servise to develop the application using H-InvDB Web service.
H-InvDB Web service provide 12 APIs.
Please refer below for the details;
List of REST APIs
List of SOAP APIs
H-InvDB Web service provide APIs of REST protocol.
To connect to the REST servise you need an environment of HTTP connection (e.g. web browser) and the programming language (e.g. Perl or JAVA).
To use the H-InvDB Web servise, please call the method and parameters to [http://h-invitational.jp/hinv/hws/keyword_search.php?query=cancer] as below;
The POST method access are approved, but the GET method may also be possible if you use the parameters below the limit of data transfer of GET method.
If you call a method with parameters including non_alphanumeric charactors, e.g. "Homo sapiens", please encode as below;
(JAVA sample)
String query = "query=" + URLEncoder.encode("Homo sapiens","UTF-8");
|
You need to keep holding the connection while you use the REST protocol, but may also call a method with asynchronous.
It will save the resource of your client PC by calling a method with asynchronous.
We introduce you the way of asynchronous call by using LWP.
The method wih "Async" at the end (e.g. keyword_search) are the method for asynchronous.
Step1. Call asynchronous service.
use LWP::UserAgent;
$ua = new LWP::UserAgent;
# make request
my $req = new HTTP::Request POST => "http://h-invitational.jp/hinv/hws/keyword_search.php";
$req->content_type("application/x-www-form-urlencoded");
# set parameters
$req->content("query=HIT00002218*&start=1&end=100");
# send request and get response.
my $res = $ua->request($req);
# show response.
print $res->content;
|
Your requestID is:20070717144558241 |
Step 2. Get a result.
use LWP::UserAgent;
$ua = new LWP::UserAgent;
# make request
my $req = new HTTP::Request POST => "http://h-invitational.jp/hinv/hws/keyword_search.php";
$req->content_type("application/x-www-form-urlencoded");
# set parameters
$req->content("query=HIT00002218*&start=1&end=100");
# send request and get response.
my $res = $ua->request($req);
# show response.
print $res->content;
|