01: package staticstub;
02:
03: import javax.xml.rpc.Stub;
04:
05: public class HelloStaticClient {
06:
07: private String endpointAddress;
08:
09: public static void main(String[] args) {
10: System.out.println("Endpoint address = " + args[0]);
11: try {
12: Stub stub = createProxy();
13: stub._setProperty(
14: javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
15: args[0]);
16: HelloSEI hello = (HelloSEI) stub;
17: System.out.println(hello.sayHello("Duke!"));
18: } catch (Exception ex) {
19: ex.printStackTrace();
20: }
21: }
22:
23: private static Stub createProxy() {
24: // Note: Hello_Impl is implementation-specific.
25: return (Stub) (new Hello_Impl().getHelloSEIPort());
26: }
27: }
|