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 service to develop the application using H-InvDB Web service.
H-InvDB Web service provide REST-APIs and SOAP-APIs.
Please refer below for the details;
List of REST APIs
List of SOAP APIs
H-InvDB Web service provide REST-APIs and SOAP-APIs.
To connect to the REST service 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 service, please call the method and parameters to [http://jbirc.jbic.or.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.
To connect to the SOAP service, please use SOAP library of programing languages.
Please access the following to connect to WSDL.
http://h-invitational.jp/hinv/hws/API?wsdl |
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 service, 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://jbirc.jbic.or.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://jbirc.jbic.or.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;
|
Here are the sample codes with SOAP or REST APIs.