java 代码
- package test;
- import javax.xml.namespace.QName;
- import org.apache.axis.client.Call;
- import org.apache.axis.client.Service;
- public class Test {
- /**
- * @param args
- * @throws Exception
- */
- public static void main(String[] args) throws Exception {
- String method = "GetServerList";
- Service service = new Service();
- Call call = (Call) service.createCall();
- call.setTargetEndpointAddress(new java.net.URL("http://hostname/BABLDWebService/Service.asmx"));
- call.setOperationName(new QName("http://tempuri.org/",method));
- call.setUseSOAPAction(true);
- call.setReturnType(org.apache.axis.encoding.XMLType.SOAP_ARRAY);
- call.setSOAPActionURI("http://tempuri.org/GetServerList");
- Object[] k = (Object[])call.invoke(new Object[]{});
- for(int i=0;i<k.length;i++)
- System.out.println(k[i]);
- }
- }