急!!!!!!!!RPCServiceClient-调用webservice客户端。。。。
无情天下 2012-12-18 07:49:16 import javax.xml.namespace.QName;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
public void callRemoteFun(){
RPCServiceClient client = null;
try {
client = new RPCServiceClient();
Options options = client.getOptions();
// 创建一个远程的访问地址
EndpointReference target = new EndpointReference("http://...");
options.setTo(target);
} catch (AxisFault e) {
e.printStackTrace();
}
Object[] objargs = new Object[] {"001","1.00","3","123456","5"};
Class[] getobj = new Class[] { String.class };
Object[] response = client.invokeBlocking(new QName("{SERVICE_NAMESPACE}", "{serviceName}"),
objargs,getobj);
String result = (String) response[0];
}
在我的webServers端的方法:
public String test1(String[] str){
System.out.println("调用成功1");
}
public String test2(String id,String name){
System.out.println("调用成功2");
}
为什么我test2的方法调用不到,我老是调用不了,是不是RPC核心就是只能传递一个object[]?还是只能调用一个带参数的方法?