String login="XXX";
String password="XXX";
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
final XmlRpcClient client = new XmlRpcClient();
final HttpClient httpClient = new HttpClient();
final XmlRpcCommonsTransportFactory factory = new
XmlRpcCommonsTransportFactory(client);
try {
factory.setHttpClient(httpClient);
client.setTransportFactory(factory);
config.setServerURL(new URL("https://bugzilla.mozilla.org/"));
client.setConfig(config);
} catch (MalformedURLException e) {
System.out.println("Wrong URL");
}
Object result = null;
Map params = new HashMap<String, Object>();
params.put("login", login);
params.put("password", password);
params.put("rememberlogin", "Bugzilla_remember");
try {
result = client.execute("User.login", new Object[]{params});
} catch (XmlRpcException e) {
System.out.println("Error invoking the bugzilla login web service");
e.printStackTrace();
}
System.out.println(result);
params.clear();
But, it doesn't work and I don't know why. The stack trace is:
[Fatal Error] loose.dtd:31:3: The declaration for the entity "HTML.Version"
must end with '>'.
org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse servers
response: The declaration for the entity "HTML.Version" must end with '>'.
at
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:177)
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:136)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)
at PruebaTest.getBugzillaConnection(PruebaTest.java:68)
at PruebaTest.testMain(PruebaTest.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.xml.sax.SAXParseException: The declaration for the entity
"HTML.Version" must end with '>'.
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:175)
... 26 more
Any ideas???
Thanks
--
View this message in context: http://www.nabble.com/-Fatal-Error--loose.dtd%3A31%3A3%3A-The-declaration-for-the-entity-%22HTML.Version%22-must-end-with-%27%3E%27.-tp20855590p20855590.html
Sent from the Bugzilla - Users mailing list archive at Nabble.com.
Wrong URL. You want https://bugzilla.mozilla.org/xmlrpc.cgi
The new WebService documentation is clearer about this.
-Max
--
http://www.everythingsolved.com/
Competent, Friendly Bugzilla and Perl Services. Everything Else, too.