81,122
社区成员




String url = "http://localhost:32828/WebServiceTest.asmx?" ;
String namespace = "http://tempuri.org/";
String methodName = "HelloWorld";
String soapActionURI = "http://tempuri.org/HelloWorld";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(url));
call.setUseSOAPAction(true);
call.setSOAPActionURI(soapActionURI);
call.setOperationName(new QName(namespace, methodName));
//call.addParameter("arg0", XMLType.XSD_STRING, ParameterMode.IN);改成arg0试过,不管用
//call.addParameter(new QName("http://tempuri.org","name"), XMLType.XSD_STRING, ParameterMode.IN); 这样也试过还是不管用
call.addParameter("name", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
Object[] params = new Object[] {"xxx"};
String result = (String) call.invoke(params);