source: axis/Create.java @ 6a03b9f

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

Example of using java to talk to fedd

  • Property mode set to 100644
File size: 1.8 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 MultiInfo message and response
27         */
28
29        NewResponseType resp = null;
30
31        /* This magic turns off certificate chain checking. */
32        XTrustProvider.install();
33
34        /* This tells the SSL system where to find client certificate
35         * information. */
36        String keyStore = "./keystore";
37        String keyStorePassword = "importkey";
38
39        System.setProperty("javax.net.ssl.keyStore", keyStore);
40        System.setProperty("javax.net.ssl.keyStorePassword", keyStorePassword);
41        IDType id = new IDType();
42
43        NewRequestType req = new NewRequestType(null, 
44                new IDType(null, null, null, args[0], null), 
45                null);
46
47
48        try {
49            /* Build the message and make the call */
50            resp = port._new(req);
51        }
52        catch (FaultType f) {
53            System.err.println("Error in New: " + f);
54            System.exit(20);
55        }
56        ExperimentLabels newLabels = 
57            new ExperimentLabels(resp.getExperimentID());
58        System.out.println("New success: " + newLabels.getLocalname() + "(" +
59            newLabels.getFedid() + ")");
60    }
61}
Note: See TracBrowser for help on using the repository browser.