标签:
importjavax.xml.namespace.QName; import org.apache.axis2.AxisFault; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.client.Options; importorg.apache.axis2.client.ServiceClient; import org.apache.axis2.rpc.client.RPCServiceClient; publicclassWebserviceTest { publicstaticvoid main(String[] args) { RPCServiceClientserviceClient; try { serviceClient = newRPCServiceClient(); Options options = serviceClient.getOptions(); //指定调用WebService的URL EndpointReferencetargetEPR = newEndpointReference(""); options.setTo(targetEPR);
//参数说明:
QNameopAddEntry = newQName("http://ws.apache.org/axis2", "pushData");
//调用pushData方法并输出该方法的返回值 System.out.println(serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, classes)[0]);
} catch (AxisFault e) { e.printStackTrace(); } }
标签:
原文地址:http://www.cnblogs.com/nyist2007/p/4624279.html