source: axis/Terminate.java @ 55de6a9

axis_examplecompt_changesinfo-ops
Last change on this file since 55de6a9 was 55de6a9, checked in by Ted Faber <faber@…>, 13 years ago

Example of using java to talk to fedd

  • Property mode set to 100644
File size: 1.4 KB
Line 
1import edu.isi.www.fedd_types.*;
2import edu.isi.www.fedd_wsdl.*;
3import java.net.URL;
4import net.deterlab.isi.XTrustProvider;
5
6class Create extends FeddCommand {
7    /**
8     * Dummy program to test an AXIS fedd implementation generated from the
9     * WSDL and run by axis.
10     * It just calls terminate with a dummy id as a local name (which can be
11     * supplied on the command line and reprints the localname that the server
12     * replies with.  A client certificate muct exist in the local keystore
13     * file with the given password.
14     */
15    public static void main(String args[]) throws 
16            javax.xml.rpc.ServiceException, java.net.MalformedURLException,
17            java.rmi.RemoteException {
18       
19        /*
20         * Boilerplate web services access stuff.
21         */
22        FeddPortType port = getPort("https://users.isi.deterlab.net:23235");
23        setUpSecurity();
24
25        /*
26         * The various parts of the Terminate message and response
27         */
28
29        TerminateRequestType req = new TerminateRequestType(null, 
30                new IDType(null, null, null, args[0], null), 
31                null);
32        NewResponseType resp = null;
33
34
35        try {
36            /* Build the message and make the call */
37            resp = port._new(req);
38        }
39        catch (FaultType f) {
40            System.err.println("Error in New: " + f);
41            System.exit(20);
42        }
43        ExperimentLabels newLabels = 
44            new ExperimentLabels(resp.getExperimentID());
45        System.out.println("New success: " + newLabels.getLocalname() + "(" +
46            newLabels.getFedid() + ")");
47    }
48}
Note: See TracBrowser for help on using the repository browser.