// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import javax.xml.rpc.*;
import javax.xml.namespace.*;

public class TestTest {
    public static String dup(String s) throws Exception {
        String endpoint = "http://localhost:8080/axis/Test.jws";
        ServiceFactory servfact = ServiceFactory.newInstance();
        Service serv = servfact.createService(new QName("localhost"));
        Call cal = serv.createCall();
        cal.setTargetEndpointAddress(endpoint);
        cal.setOperationName(new QName("dup"));
        Object[] arg = new Object[1];
        arg[0] = s;
        return (String)cal.invoke(arg);
    }
    public static void main(String[] args) throws Exception {
        System.out.println(dup("a"));
        System.out.println(dup("bb"));
        System.out.println(dup("ccc"));
    }
}
