hello
i have problem with apache xml-rpc lib in my code
my code:
i want to communicate with aria2c command line software to send it url to download but i receive this error when i compile my code:package com.thr.FireEagle; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import org.apache.xmlrpc.XmlRpcException; import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; public class JavaClient{ public static void main( String[] args ) { ArrayList<String> params = new ArrayList<String>(); params.add( new String("http://rs230dt.rapidshare.com/files/344243800/10012723.LinuxCBT.Debian.part8.rar")); System.out.println( "execute" ); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); try { config.setServerURL(new URL("http://localhost:6800/rpc")); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } XmlRpcClient client = new XmlRpcClient(); client.setConfig(config); try { client.execute(config, "aria2.addUri", params); } catch (XmlRpcException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }
ERROR occurred at lineexecute org.apache.xmlrpc.XmlRpcException: URI is not provided. at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197) at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156) at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143) at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69) at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56) at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167) at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158) at com.thr.FireEagle.JavaClient.main(JavaClient.java:32)
tis is aria2.addUri method descriptions with python code:client.execute(config, "aria2.addUri", params);
please help me to solve my problem.aria2.addUri (uris[, options[, position]]) Description This method adds new HTTP(S)/FTP/BitTorrent Magnet URI. uris is of type array and its element is URI which is of type string. For BitTorrent Magnet URI, uris must have only one element and it should be BitTorrent Magnet URI. URIs in uris must point to the same file. If you mix other URIs which point to another file, aria2 does not complain but download may fail. options is of type struct and its members are a pair of option name and value. See Options below for more details. If position is given as an integer starting from 0, the new download is inserted at position in the waiting queue. If position is not given or position is larger than the size of the queue, it is appended at the end of the queue. This method returns GID of registered download. Example The following example adds http://example.org/file to aria2: >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> s.aria2.addUri(['http://example.org/file']) '1'
thanks