java xml-rpc

Mina Amin minaavictor at hotmail.com
Tue Sep 25 14:09:43 UTC 2007


This is the code, i use to invoke the Bugzilla API, also I'm using version 3.0.1 and when invoking the Version API it return the it correctly.but the problem with the User.login API. XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL("http://<VMware virtual IP>/bugzilla/xmlrpc.cgi"));
 
XmlRpcClient client = new XmlRpcClient();client.setConfig(config);
 
Object result = client.execute("User.login", new Object[] {"mina at bugzilla.com", "password"});System.out.println(result);Note that execute takes a list or object[] as its second parameter.and the exception is 
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
at org.apache.xmlrpc.parser.XmlRpcResponseParser.addResult(XmlRpcResponseParser.java:58)
at org.apache.xmlrpc.parser.RecursiveTypeParserImpl.endValueTag(RecursiveTypeParserImpl.java:71)
at org.apache.xmlrpc.parser.XmlRpcResponseParser.endElement(XmlRpcResponseParser.java:183)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:175)
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:136)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)at com.newportmediainc.bzc.executer.BZCApplication.main(BZCApplication.java:31) and the TCP dump using wiresharkfaultString
Can't use string ("<email account>") as a HASH ref while "strict refs" in use at Bugzilla/WebService/User.pm line 39.\nfaultcode 
server // i think this is the problem as it must return a numerical code.
I believe that the problem in how to send a parameters with the method name. so if anyone did it via java and apach xml-rpc please give a hand.
 
thx.
 
Mina

> Date: Mon, 24 Sep 2007 16:17:21 -0700> From: mkanat at bugzilla.org> To: developers at bugzilla.org> Subject: Re: java xml-rpc> > On Mon, 24 Sep 2007 13:20:59 +0000 Mina Amin <minaavictor at hotmail.com>> wrote:> > I'm developing a bugzilla client under java application that use> > bugzilla xml-rpc API, when using the "User.login" method a cast> > exception occurs.. any help NOTE: i'm using java 6 with apach xml-rpc> > library > > You're going to have to be way more specific than that. Show us> what code you wrote, and show us the exact error.> > Also, you're probably better off asking the people who wrote> the library, instead of us. As long as you're following the Bugzilla> API, you should be fine. Just realize that all arguments are a hash (a> Map in Java terms).> > -Max> -- > http://www.everythingsolved.com/> Competent, Friendly Bugzilla Services. And Everything Else, too.
_________________________________________________________________
More photos; more messages; more whatever – Get MORE with Windows Live™ Hotmail®. NOW with 5GB storage.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_5G_0907
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bugzilla.org/pipermail/developers/attachments/20070925/3eb66191/attachment.html>


More information about the developers mailing list