import java.net.MalformedURLException;
import java.rmi.RemoteException;
import java.util.Vector;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class sss {
public static void main(String[] args) {
try {
//服务端URL
String endpoint = "http://localhost:8118/DPWHMSWS/DPWHMSWS?wsdl";
Service service = new Service();
Call call = (Call) service.createCall();
//设置Web Services的URL地址
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://schemas.xmlsoap.org/wsdl/soap/", "zdy_study_logic"));
//设置参数
call.addParameter(new QName("http://schemas.xmlsoap.org/wsdl/soap/", "boradNo"),
org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);
//设置返回值类型
call.setReturnType(org.apache.axis.Constants.SOAP_VECTOR);
//返回值
// String ret = (String) call.invoke( new Object[] { "numen" } );
Vector ret = (Vector) call.invoke( new String[] { "9931T01A018BC00005"} );
System.out.println("Send: '9931T01A018BC00005'");
for(int i=0;i
System.out.println("Recv: " + ret.get(i));
}
} catch (ServiceException se) {
se.printStackTrace();
} catch (MalformedURLException murle) {
murle.printStackTrace();
} catch (RemoteException re) {
re.printStackTrace();
}
}
}
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: QxCartonInfoImpl.zdy_study_logic(Ljava/lang/String;)Ljava/lang/String; [java.lang.NoSuchMethodError]
faultActor: /DPWHMSWS/DPWHMSWS
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:QxCartonInfoImpl.zdy_study_logic(Ljava/lang/String;)Ljava/lang/String; [java.lang.NoSuchMethodError]
怎么才能返回数组 最好是ArrayList型