import jp.dbcls.togows.soap.*;

public class DdbjGetentryGetBlocksEntryAsync {

    public static void main(String[] args) {
        try {
            String accession = "IPB000009A"; 

            TogowsDdbjGetentryService service = new TogowsDdbjGetentryServiceLocator();
            TogowsDdbjGetentryPort stub = service.getTogowsDdbjGetentryPort();

            String jobid = stub.ddbjGetentryGetBlocksEntryAsync(accession);

            String status = null;
            do {
                try {
                    Thread.sleep(10000);
                } catch (Exception e) {
                }
                status = stub.checkAsyncStatus(jobid);
                System.out.println(status);
            } while (status.equals("RUNNING"));

            String result = stub.ddbjGetentryGetBlocksEntryAsyncResult(jobid);
            System.out.println(result);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
