0
我正在尝试如何在python中使用org.apache.xmlrpc.client.XmlRpcClient。请帮助将xmlrpc java语法移植到python
我使用的代码https://github.com/mcasperson/vaultdemo/blob/master/src/main/java/com/redhat/ecs/App.java:
final XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL(args[0]));
config.setBasicUserName(args[1]);
config.setBasicPassword(args[2]);
final XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
final Object[] params = new Object[] {"1376"};
final String retValue = (String) client.execute("ContentAPI.queryResult", params);
我尝试下面的Python代码,但我没有得到任何地方:
from xmlrpclib import ServerProxy
s = ServerProxy(url)
print s.client.execute("ContentAPI.queryResult",1376)
什么我如何通过用户名和密码到python的ServerProxy客户端?
你的帮助是非常赞赏
感谢找回,我已经工作了: 从进口的xmlrpclib ServerProxy URL =“https://开头的用户名:密码@服务器: port/xplrpc“ s = ServerProxy(url) print s.ContentAPI.queryResult(”1376“) –