日期:2014-05-20 浏览次数:20900 次
public class Test {
public static void main(String[] args1) throws AxisFault {
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference(
"http://127.0.0.1:8080/axis2/services/MyService");
options.setTo(targetEPR);
// /////////////////////////////////////////////////////////////////////
/*
* Creates an Entry and stores it in the AddressBook.
*/
// QName of the target method
QName opAddEntry = new QName("http://webservice.rp.mid.com/xsd", "createResourceTemplate");
/*
* Constructing a new Entry
*/
AddResourceTemplateRequestMsg entry = new AddResourceTemplateRequestMsg();
entry.setResourceTemplateID("testtttt") ;
entry.setTransactionId("testaaaaa") ;
// 此处可换成String数组传入即可。
Object[] opAddEntryArgs = new Object[] { entry };
Class[] returns = new Class[]{AddResourceTemplateResponseMsg.class} ;
// Invoking the method
Object[] obj = serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, returns) ;
////////////////////////////////////////////////////////////////////////
}
}