java中的XMLRPC调用没有参数的方法?
我在服务器中有一个没有参数的远程方法。我无法从java客户端调用它。但我可以调用带有参数的方法
**XmlRpcClient client = new XmlRpcClient();
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL("http://localhost:8000"));
client.setConfig(config);
Object[] params = new Object[]{null};
Object result = client.execute("hello",params);
System.out.println(result);**
# 1 楼答案
使用
new Object[] {null}
假设至少有一个参数(null)。 您只需要创建一个空数组: