我想从 Java 进行 XML-RPC,在传递关联数组(Hashmap)作为参数时遇到问题。这是我的代码。
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL(ServeUrl));
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
Map map = new HashMap();
map.put(Parameter Name, Parameter Value);
map.put(Parameter Name , Parameter Value);
Object result = client.execute("method name", map);
最佳答案
HashMap 需要包装在对象数组中:
Object result = client.execute("method name", new Object [] {map});
关于java - 将关联数组(Hashmap)作为参数传递给 xml rpc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4971770/