01: /*
02: * Copyright 2001-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package samples.transport.tcp;
18:
19: import org.apache.axis.EngineConfiguration;
20: import org.apache.axis.SimpleTargetedChain;
21: import org.apache.axis.client.Call;
22: import org.apache.axis.configuration.DefaultEngineConfigurationFactory;
23: import org.apache.axis.configuration.SimpleProvider;
24:
25: /**
26: * An admin client object, which will work with the TCP transport.
27: *
28: * @author Rob Jellinghaus (robj@unrealities.com)
29: * @author Doug Davis (dug@us.ibm.com)
30: * @author Glen Daniels (gdaniels@apache.org)
31: */
32:
33: public class AdminClient extends org.apache.axis.client.AdminClient {
34: public static void main(String args[]) {
35:
36: Call.addTransportPackage("samples.transport");
37: Call.setTransportForProtocol("tcp", TCPTransport.class);
38:
39: // Deploy the transport on top of the default client configuration.
40: EngineConfiguration defaultConfig = (new DefaultEngineConfigurationFactory())
41: .getClientEngineConfig();
42: SimpleProvider config = new SimpleProvider(defaultConfig);
43: SimpleTargetedChain c = new SimpleTargetedChain(new TCPSender());
44: config.deployTransport("tcp", c);
45:
46: AdminClient.setDefaultConfiguration(config);
47:
48: try {
49: org.apache.axis.client.AdminClient client = new org.apache.axis.client.AdminClient(
50: true);
51:
52: System.out.println(client.process(args));
53: } catch (Exception e) {
54: System.err.println(e);
55: e.printStackTrace(System.err);
56: }
57: }
58: }
|