Bugzilla WebServices from Java client, getting Login required after successful login...
sm4rtus
sm4rtus at gmail.com
Wed Nov 19 13:23:49 UTC 2008
Hi,
I successfully managed to login to the bugzilla via the webservices
api. I set up the apache xml rpc to use the cookies (at least I think
so), but I am still not able to use another commad, because I am
getting Login Required error message from Bugzilla.
Here is the code I use:
---
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
final XmlRpcClient client = new XmlRpcClient();
final HttpClient httpClient = new HttpClient();
final XmlRpcCommonsTransportFactory factory = new
XmlRpcCommonsTransportFactory(client);
factory.setHttpClient(httpClient);
client.setTransportFactory(factory);
config.setServerURL(new URL("http://mybugzilla/xmlrpc.cgi"));
client.setConfig(config);
Object result = null;
Map params = new HashMap<String, Object>();
params.put("login", "myname");
params.put("password", "mypass");
params.put("rememberlogin", "Bugzilla_remember"); // not sure
about this line
result = client.execute("User.login", new Object[]{params});
System.out.println(result);
params.clear();
result = client.execute("User.logout", new Object[]{params});
System.out.println(result);
params.clear();
_______________________________________________
dev-apps-bugzilla mailing list
dev-apps-bugzilla at lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-apps-bugzilla
More information about the developers
mailing list