// 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.*;
import javax.xml.rpc.encoding.*;

public class TestManual {
    public static void main(String[] args) throws Exception {
        ServiceFactory sf = ServiceFactory.newInstance();
        Service s = sf.createService(new QName("http://arne/"));
        Call cal = s.createCall();
        cal.setTargetEndpointAddress("http://localhost:81/SimpleTest.asmx");
        cal.setOperationName(new QName("http://arne/", "AddOne"));
        cal.setProperty(Call.SOAPACTION_USE_PROPERTY, true);
        cal.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://arne/AddOne");
        cal.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY , "literal");
        //cal.addParameter("v", XMLType.XSD_INT, Integer.class, ParameterMode.IN);
        ((org.apache.axis.client.Call)cal).addParameter(new QName("http://arne/", "v"), XMLType.XSD_INT, Integer.class, ParameterMode.IN);
        cal.setReturnType(XMLType.XSD_INT);
        System.out.println(cal.invoke(new Object[] { 2 } ));
    }
}
