Need some help interacting with an XML-RPC server Programming Software Development by leiger …quot;); try { // Create an object to represent the server XmlRpcClient myServer = new XmlRpcClient(server_url); // TODO: I want… work ;-) } catch (Exception e) { System.err.println("JavaClient: " + e.toString()); } System.out.println("REACHED … Socket programming ansic server to java client Programming Software Development by Jnk …this code in java as the client: [CODE] class Javaclient { private static DataInputStream input; private static PrintStream output;…+ line); } } [/CODE] I am sending from the socket server(in c) data to this java client. My problem is…data is not printed until I stop the c server. So when I do stop it it prints… Re: Need some help interacting with an XML-RPC server Programming Software Development by ~s.o.s~ Have you tried to understand the client examples posted on the [URL="http://ws.apache.org/xmlrpc/client.html"]official XML-RPC site[/URL]? IMO, something like [icode]client.execute("System.listMethods", new ArrayList())[/icode] or [icode]client.execute("system.listMethods", new ArrayList())[/icode] should do the trick. Re: Need some help interacting with an XML-RPC server Programming Software Development by leiger I definitely looked at the official website, but I don't remember seeing that particular page. I think those instructions might be out of date though. For one thing it suggests: [CODE]import org.apache.xmlrpc.client.XmlRpcClient;[/CODE] That couldn't be found on my machine. I checked the Jar file and found that it wasn't in a subfolder called … Re: Need some help interacting with an XML-RPC server Programming Software Development by ~s.o.s~ To find out which JAR a given class belongs to, use a service like GrepCode. It tells you all the possible JAR files which has that particular class along with providing download for the same. For e.g. here's the [URL="http://grepcode.com/snapshot/repo1.maven.org/maven2/org.apache.xmlrpc/xmlrpc-client/3.1.3/"]grepcode result[/URL] for the… Re: Need some help interacting with an XML-RPC server Programming Software Development by leiger I was able to get system.listMethods working eventually. Turned out that the latest version of Apache XML-RPC only had [I]some[/I] of the JARs I needed... for some strange reason. Had to search through Google for the rest. Now I'm having more problems - any method that requires a parameter doesn't work :S (I can't seem to figure out what data type… Re: Need some help interacting with an XML-RPC server Programming Software Development by ~s.o.s~ What do you mean by "doesn't work"? Exception? No result? Anyways, have you tried passing in an Object array as shown in the official documentation? Paste the code you are using. Re: Need some help interacting with an XML-RPC server Programming Software Development by leiger As I mentioned, "I can't seem to figure out what data type to pass in!". What I mean by that is that I am getting an XmlRpcException with the message "Calling parameters do not match signature". [CODE] CLASS: class org.apache.xmlrpc.XmlRpcException MESSAGE: Calling parameters do not match signature [/CODE] Passing in an empty … Re: Need some help interacting with an XML-RPC server Programming Software Development by leiger Solved the problem. The Apache XML-RPC libraries only accepted a List and Object[] ... so I was trying to explicitly cast to Object[] instead, and was getting problems with that. This worked (passing in a Hashtable, inserted into an Object[]), as it is passing in an Object[] array as the parameter... and the method accepted it: [CODE=Java] // … Re: Need some help interacting with an XML-RPC server Programming Software Development by ~s.o.s~ > Solved the problem Good thing that you could come up with a solution on your own. A couple of points though in case you are starting with Java: [LIST] [*] Declare/define variables closest to their usage point. In your code, you create an object array on the first line and use it on the 4th line. The lesser the scope of your variables … Re: Need some help interacting with an XML-RPC server Programming Software Development by leiger I've taken your suggestions on board and have modified my code as you suggested. [I][B]>[/B] A thousand declarations at the start of a method add to the confusion.[/I] Usually, I would compact my code as much as possible when I'm writing it (with the exception that I dislike using the shortened form of an if statement). As anything networking… Re: Socket programming ansic server to java client Programming Software Development by NormR1 The readLine() method is for reading lines. A line ends with an line end character. The readLine method will continue reading until it gets a lineend. Some solutions: Use the read method and read the data into an array as it comes or have the sender add line end characters Re: Socket programming ansic server to java client Programming Software Development by Jnk Thanks! Adding the endline did the trick. Help with Java Program Retrieving from Hashtable Programming Software Development by Roegadyn … argVect); } catch (XmlRpcException exception) { System.err.println("JavaClient: XML-RPC Consumer Fault #" + Integer.toString(exception.code)…CODE] The Bank Accounts Class in the server package is [CODE]package server; import java.util.Hashtable; import java… Using xmlRpc in java Programming Software Development by thr … these exceptions [CODE]org.apache.xmlrpc.XmlRpcException: Failed to read server's response: Connection refused at org.apache.xmlrpc.client.XmlRpcStreamTransport….apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147) at Aria2c.JavaClient.main(JavaClient.java:30) Caused by: java.net.ConnectException: Connection refused… Re: Help with Java Program Retrieving from Hashtable Programming Software Development by Roegadyn …} catch (XmlRpcException exception) { System.err.println("JavaClient: XML-RPC Consumer Fault #" + Integer.toString(exception… @SuppressWarnings("unchecked")][/CODE] XMLRPCServer [CODE]package server; import org.apache.xmlrpc.WebServer; public class XMLRPCServer {… Re: Help with Java Program Retrieving from Hashtable Programming Software Development by moutanna Hi; it seem that you'r using a deprecated version of the apach xmlrpc; the class XmlRpcClient in new version (published 15-Feb-2010) is located in the package org.apache.xmlrpc.client instead of org.apache.xmlrpc.XmlRpcClient. ANd there are some littel changes. Hope it helps Re: Help with Java Program Retrieving from Hashtable Programming Software Development by gmunk I made some changes to your BankAccount class. I suggest you revise your program logic though, because somethings are quite peculiar. [CODE] import java.util.Hashtable; import java.util.Enumeration; import java.util.Vector; public class BankAccount { private Hashtable<String, String> BankAccounts = new Hashtable<String, String&… Re: Help with Java Program Retrieving from Hashtable Programming Software Development by Roegadyn Thank you both of you for your help Moutanna I am using an older version of XMLRPC which probably explains why my code is the way it is. It works fine on my program I am attempting to butcher to make this work and it was supplied to us from our lecturer. I will try the newer version a little later. gmunk Thank you very much for taking the time … Re: Using xmlRpc in java Programming Software Development by leiger I had problems with XML-RPC in Java a few months back, but eventually got it working. It looks like you're heading in the right direction. You seem to be using the correct libraries. Do you know why the connection is being refused? Is it possible that you need to authenticate yourself first using a username and password? I will have a look at …