import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Vector; import javax.xml.namespace.QName; import org.apache.axis.client.Call; import org.apache.axis.client.Service; public class Aa { private String url="http://10.74.55.17:88/service.asmx?wsdl";
private String soapaction="http://tempuri.org/"; public Aa() { String UcId = "90900187";
Service service=new Service(); try{ Call call=(Call)service.createCall(); call.setTargetEndpointAddress(url); call.setOperationName(new QName(soapaction,"GetRecordUrl")); //设置要调用哪个方法 call.addParameter(new QName(soapaction,"UcId"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter(new QName(soapaction,"GetRecordUrlResult"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.OUT);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);//(标准的类型) call.setUseSOAPAction(true); call.setSOAPActionURI(soapaction + "GetRecordUrl");
String result = (String)call.invoke(new Object[]{UcId});
System.out.println("result is ss"+result);
}catch(Exception ex) { ex.printStackTrace(); } } public static void main(String args[]) { Aa pw=new Aa(); } }
//======问题是
不管UcId 换成其他的,result 的值都是一样的,
在webservice网页中取result正确的.
private String soapaction="http://tempuri.org/"; public Aa() { String UcId = "90900187";
Service service=new Service(); try{ Call call=(Call)service.createCall(); call.setTargetEndpointAddress(url); call.setOperationName(new QName(soapaction,"GetRecordUrl")); //设置要调用哪个方法 call.addParameter(new QName(soapaction,"UcId"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter(new QName(soapaction,"GetRecordUrlResult"),org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.OUT);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);//(标准的类型) call.setUseSOAPAction(true); call.setSOAPActionURI(soapaction + "GetRecordUrl");
String result = (String)call.invoke(new Object[]{UcId});
System.out.println("result is ss"+result);
}catch(Exception ex) { ex.printStackTrace(); } } public static void main(String args[]) { Aa pw=new Aa(); } }
//======问题是
不管UcId 换成其他的,result 的值都是一样的,
在webservice网页中取result正确的.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货