Skip to main content

Problem with apache xml-rpc lib

1 reply [Last post]
tah_206207
Offline
Joined: 2011-04-22
Points: 0

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

<br />
package com.thr.FireEagle;</p>
<p>import java.net.MalformedURLException;<br />
import java.net.URL;<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("http://rs230dt.rapidshare.com/files/344243800/10012723.LinuxCBT.Debian.part8.rar"));<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 />
	          client.setConfig(config);</p>
<p>	          try {<br />
	            client.execute(config, "aria2.addUri", params);<br />
	         } catch (XmlRpcException e1) {<br />
	            // TODO Auto-generated catch block<br />
	            e1.printStackTrace();<br />
	         }</p>
<p>	    }<br />
	}</p>
<p>

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(XmlRpcStreamTransport.java:197)<br />
	at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)<br />
	at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)<br />
	at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)<br />
	at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)<br />
	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)<br />
	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)<br />
	at com.thr.FireEagle.JavaClient.main(JavaClient.java:32)</p>
<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="http://example.org/file" title="http://example.org/file">http://example.org/file</a> to aria2:</p>
<p>>>> import xmlrpclib<br />
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')<br />
>>> s.aria2.addUri(['http://example.org/file'])<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.
quicktosoft
Offline
Joined: 2011-04-24
Points: 0

this is very simple problem. you just visit this website
http://www.quick2soft.com/contactus.php