Gentlemen,
Im trying to create a bug in a local bugzilla installation using the
bugzilla xml-rpc api but I have a problem with login.
When I call the services that dont require login (get products or legal
values, for example), its working fine. But when I try to create a bug, I
get the following exception:
org.apache.xmlrpc.XmlRpcException: Login Required
at
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:186)
at
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:145)
at
org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)
at
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:44)
at
org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:157)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:146)
I tried to run the login before calling the create but. The login works
fine, it returns the logged user id, but when I call the create I got the
same error.
I tried to put the username and login in the URL but again I got the same
error.
Im using the following code to create the config:
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL("
http://localhost/bugzilla/xmlrpc.cgi"));
config.setBasicUserName("myusername");
config.setBasicPassword("mypassword");
and the following code to call the service:
XmlRpcClient xmlRpcClient = new XmlRpcClient();
xmlRpcClient.setConfig(config);
Map<Object, Object> result = (Map<Object,
Object>)xmlRpcClient.execute("Bug.create", params);
Did anyone have the same problem before or have an idea of what should I do
?
Thanks in advance,
--
Helder Ribeiro