source: axis/Terminate.java @ cfc4d68

compt_changesinfo-ops
Last change on this file since cfc4d68 was cfc4d68, checked in by Ted Faber <faber@…>, 12 years ago

Take url as a parameter for easier testing

  • Property mode set to 100644
File size: 1.2 KB
Line 
1// WSDL generated classes
2import edu.isi.www.fedd_types.*;
3import edu.isi.www.fedd_wsdl.*;
4
5// The fault thrown by failed commands
6import org.apache.axis.AxisFault;
7
8class Terminate extends FeddCommand {
9    /**
10     * Terminate the experiment with the menmonic name given on the command
11     * line.
12     */
13    public static void main(String args[]) throws 
14            javax.xml.rpc.ServiceException, java.net.MalformedURLException,
15            java.rmi.RemoteException {
16
17        boolean force = args.length > 2;
18        String exptName = "test";
19        String urlString = "https://users.isi.deterlab.net:23235";
20
21        if (args.length > 0) exptName = args[0];
22        if (args.length > 1) urlString = args[1];
23
24        // Get the port and construct the (simple) request.
25        FeddPortType port = getPort(urlString);
26        TerminateRequestType req = new TerminateRequestType(
27                new IDType(null, null, null, exptName, null), 
28                force);
29        TerminateResponseType resp = null;
30
31
32        try {
33            /* Build the message and make the call */
34            resp = port.terminate(req);
35        }
36        catch (AxisFault f) {
37            System.err.println("Error in Terminate: " + f);
38            System.exit(20);
39        }
40        System.out.println("Terminate success: " + 
41                resp.getExperiment().getLocalname());
42    }
43}
Note: See TracBrowser for help on using the repository browser.