日期:2014-05-17 浏览次数:21591 次
package com.how.client;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import org.apache.axis.Constants;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class ClientTest {
public static void main(String[] args) {
String url="http://119.97.200.187/WebServiceJyzx.asmx?wsdl";
String namespace = "http://tempuri.org/";
String methodName = "Getbdxx";
String soapActionURI = "http://tempuri.org/Getbdxx";
Service service = new Service();
try{
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(new QName(namespace,"42010520091124008"),Constants.XSD_STRING,ParameterMode.IN);
call.setReturnType(Constants.XSD_STRING);
String ret = (String) call.invoke(new Object[]{"222"});
System.out.println("返回结果---> " + ret);
}catch(Exception e){
e.printStackTrace();
}
}
}