Im working on a project right now... where I am creating an Integration Layer for a front-end system and mutliple backend systems. XML-RPC of course would do it best. But the way the client wants it is that the front end system should act as if its stand-alone and should only inform the backend systems to replicate the transactions on their end. Furthermore, their backend systems are quite a lot and some unreliable as of the moment, they also required that the Integration Layer should poll these transactions to a configurable time before it is sent to the backend.
My solution was to save the incomming XML-RPC's actual XMLs into the database. The polling would just be a thread that would pick up the saved XMLs and send them as if their realtime XML-RPC calls. The backends responds and then pushes the XML response out. I again save this in my Integration layer db on the same transaction. This means the frontend can now do getActivityStatus(activityid) and would actually get an object response to the method it tried to invoke earlier. The easiest for me to do this was in this manner... //PATCH: ********** XmlRpcClient.java********* public String executeXML(String XmlRpcPayload) throws XmlRpcException, IOException { Worker worker = getWorker(false); try { worker.execute(XmlRpcPayload); return worker.getXML(); } finally { releaseWorker(worker, false); } } //PATCH: ********** XmlRpcClient.java$Worker class *** String xmlResult = null; public String getXML(){ return xmlResult; } Object execute(String XmlRpcPayload) throws XmlRpcException, IOException { fault = false; long now = 0; if (XmlRpc.debug) { System.out.println("Client sent:\n"+XmlRpcPayload+"\n"); now = System.currentTimeMillis(); } try { byte[] request = XmlRpcPayload.getBytes(); URLConnection con = url.openConnection(); con.setDoInput(true); con.setDoOutput(true); con.setUseCaches(false); con.setAllowUserInteraction(false); con.setRequestProperty("Content-Length", Integer.toString(request.length)); con.setRequestProperty("Content-Type", "text/xml"); if (auth != null) { con.setRequestProperty("Authorization", "Basic " + auth); } OutputStream out = con.getOutputStream(); out.write(request); out.flush(); out.close(); BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream())); int c; xmlResult = ""; while ((c = br.read()) != -1) { xmlResult+=(char)c; } parse(new java.io.ByteArrayInputStream(xmlResult.getBytes())); //I didnt change anything else after this. Im not sure if this would be a good addition to the XML-RPC package. But in terms of functionality... the versatility of being able to still get the input and output xml is a definite plus. Regards, Ron __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail