gpt4 book ai didi

java - 将关联数组(Hashmap)作为参数传递给 xml rpc

转载 作者:数据小太阳 更新时间:2023-10-29 02:59:11 25 4
gpt4 key购买 nike

我想从 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com