Results 1 to 3 of 3
  1. #1
    tah_206207 is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Question communicate with xml-rpc

    hello everyone i want to communicate with xml-rpc in my code but i can't! and get error when i compile my code.
    my code
    Java Code:
    package com.thr.FireEagle;
    import java.net.MalformedURLException;
    import org.apache.xmlrpc.XmlRpcException;
    import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
    import java.net.URL;
    import org.apache.xmlrpc.client.XmlRpcClient;
    //import java.util.Vector;
    
    public class JavaClient {
    	private static Object[] params;
    	   public JavaClient( )
    	   {
    	      params = new Object[] { "http://dl4.mihandownload.com/2011/Alipour0c/2011.4/Welcome_MAC_World_Mihandownload.com.rar" };
    	   }
    	       public static void main( String[] args )
    	       {
    	          System.out.println( "execute" );
    	          XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    	          try {
    	            config.setServerURL(new URL("http://127.0.0.1:6800/rpc"));
    	         } catch (MalformedURLException e) {
    	            // TODO Auto-generated catch block
    	            e.printStackTrace();
    	         }
    	          XmlRpcClient client = new XmlRpcClient();
    	          client.setConfig(config);
    	                   
    	          try {
    	            client.execute("aria2.addUri", params );
    	         } catch (XmlRpcException e1) {
    	            // TODO Auto-generated catch block
    	            e1.printStackTrace();
    	         }
    	         
    
    	    }
    
    }
    i get this error when i compile my code!
    Java Code:
    execute
    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:137)
    	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
    	at com.thr.FireEagle.JavaClient.main(JavaClient.java:29)
    error occurred at line:
    Java Code:
    client.execute("aria2.addUri", params );
    but i don't no how to fix it!
    unfortunately aria2 has the method aria2.addUri but i surprised what in code i can't communicate with aria2!
    please help me to fix this problem.

  2. #2
    tah_206207 is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    No everyone can help me?

  3. #3
    tah_206207 is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    If i want to create gui for aria2c you encourage me to use xml-rpc or JSON-RPC? which is better in java programming language? i can't communicate with xml-rpc in my code!
    please help me to choose best approach.
    tnx

Similar Threads

  1. trying to communicate between classes
    By rippon in forum New To Java
    Replies: 8
    Last Post: 02-09-2011, 11:20 PM
  2. Communicate with serial port
    By anilkumar_vist in forum New To Java
    Replies: 9
    Last Post: 12-24-2009, 05:53 PM
  3. Communicate JFrame with JDialog
    By BeRniTo in forum AWT / Swing
    Replies: 2
    Last Post: 08-31-2009, 02:07 PM
  4. Communicate between Windows and UNIX
    By nwboy74 in forum Networking
    Replies: 10
    Last Post: 11-04-2008, 08:53 PM
  5. Communicate vb.NET with Java
    By cachi in forum Advanced Java
    Replies: 1
    Last Post: 08-02-2007, 12:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •