Skip to main content

Problem with apache xml-rpc lib

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2011-04-22

i have problem with apache xml-rpc lib in my code
my code:

<br />
package com.thr.FireEagle;</p>
<p>import;<br />
import;<br />
import java.util.ArrayList;</p>
<p>import org.apache.xmlrpc.XmlRpcException;<br />
import org.apache.xmlrpc.client.XmlRpcClient;<br />
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;</p>
<p>public class JavaClient{</p>
<p>	       public static void main( String[] args )<br />
	       {<br />
	    	   ArrayList<String> params = new ArrayList<String>();<br />
	    	   params.add( new String(""));<br />
	          System.out.println( "execute" );<br />
	          XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();<br />
	          try {<br />
	            config.setServerURL(new URL("http://localhost:6800/rpc"));<br />
	         } catch (MalformedURLException e) {<br />
	            // TODO Auto-generated catch block<br />
	            e.printStackTrace();<br />
	         }<br />
	          XmlRpcClient client = new XmlRpcClient();<br />
<p>	          try {<br />
	            client.execute(config, "aria2.addUri", params);<br />
	         } catch (XmlRpcException e1) {<br />
	            // TODO Auto-generated catch block<br />
	            e1.printStackTrace();<br />
<p>	    }<br />

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:
<br />
execute<br />
org.apache.xmlrpc.XmlRpcException: URI is not provided.<br />
	at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(<br />
	at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(<br />
	at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(<br />
	at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(<br />
	at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(<br />
	at org.apache.xmlrpc.client.XmlRpcClient.execute(<br />
	at org.apache.xmlrpc.client.XmlRpcClient.execute(<br />
	at com.thr.FireEagle.JavaClient.main(</p>

ERROR occurred at line
<br />
client.execute(config, "aria2.addUri", params);<br />

tis is aria2.addUri method descriptions with python code:
<br />
aria2.addUri (uris[, options[, position]])</p>
<p>Description<br />
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.</p>
<p>Example<br />
The following example adds <a href="" title=""></a> to aria2:</p>
<p>>>> import xmlrpclib<br />
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')<br />
>>> s.aria2.addUri([''])<br />
'1'<br />

please help me to solve my problem.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2011-04-24

this is very simple problem. you just visit this website