Bugzilla Webservice API -> Named argument problem

chandu vivekmanchanda12 at gmail.com
Thu Nov 20 13:56:04 UTC 2008


On Nov 13, 7:03 pm, "Jethro Borsje" <jethrobor... at gmail.com> wrote:
> Hello everybody,
>
> I am trying to let my Java application connect to Bugzilla (v3.0.6)
> via the Webservice API. I am using xmlrpc-3.1 from apache, and I am
> trying to make it work as a small test case program. In order to login
> to Bugzilla I try the following:
> [code]
> // Initialize everything.
> HttpClient httpClient = new HttpClient();
> XmlRpcClient rpcClient = new XmlRpcClient();
> XmlRpcCommonsTransportFactory factory = new
> XmlRpcCommonsTransportFactory(rpcClient);
> XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
> factory.setHttpClient(httpClient);
> rpcClient.setTransportFactory(factory);
> try
> {
>    config.setServerURL(new URL("http://cia/bugzilla/xmlrpc.cgi"));}
>
> catch (MalformedURLException ex)
> {
>    ex.printStackTrace();
>    System.exit(-1);}
>
> rpcClient.setConfig(config);
>
> List<String> loginList = new ArrayList<String>();
> loginList.add("login");
> loginList.add("<username>@<domain>.com");
> loginList.add("password");
> loginList.add("<password>");
> loginList.add("rememberlogin");
> loginList.add("Bugzilla_remember");
>
> // login to bugzilla
> Object loginResult = rpcClient.execute("User.login", loginList);
> System.out.println(loginResult);
> [/code]
>
> This results in the following error from Bugzilla:
> [error]
> Exception in thread "main" org.apache.xmlrpc.XmlRpcException: Can't
> use string ("login") as a HASH ref while "strict refs" in use at
> Bugzilla/WebService/User.pm line 39.
>         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.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)
>         at bugzilla.BugzillaAutoCreate.main(BugzillaAutoCreate.java:70)
> [/error]
>
> I read that I have to use "named arguments", but I am not sure how to
> do this. Can somebody please explain to me how to create the proper
> argument for the rpcClient.execute("User.login", <argument>);?
>
> --
> Best regards,
> Jethro Borsje
>
> http://www.jborsje.nl
> -
> To view or change your list settings, click here:
> <http://bugzilla.org/cgi-bin/mj_wwwusr?user=dev-apps-bugzi...@lists.mozilla.org>

> Hi
>
> I  am trying to Integrate bugzilla but I am not able to get any Web
> Services or WSDl related to that I was hoping if you can provide me
> the WSDL or some link from where I can find this Web Services or WSDL.
>
> Any help will be great.

Vivek Manchanda
_______________________________________________
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