package helloWSclient;

import javax.xml.rpc.Stub;

public class HelloClient {

    private String endpointAddress;

    public String RemoteCall(String endPoint, String HelloTo){
	String result ="NULL";
        System.out.println("Endpoint address = " + endPoint);
        try {
            Stub stub = createProxy();
            stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, 
                endPoint); 
            HelloIF hello = (HelloIF)stub;
            result = hello.sayHello(HelloTo);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
	return result;
    }    

    private static Stub createProxy() {
        // Note: MyHelloService_Impl is implementation-specific.
        return (Stub)(new MyHelloService_Impl().getHelloIFPort());
    }
}
