1 package org.tigris.scarab.util; 2 3 import java.net.URL ; 4 import java.util.Vector ; 5 6 import org.apache.fulcrum.xmlrpc.DefaultXmlRpcClientComponent; 7 import org.apache.fulcrum.xmlrpc.XmlRpcClientComponent; 8 9 17 public class SimpleHandlerClient 18 { 19 20 public void testXmlRpc() throws Exception 21 { 22 XmlRpcClientComponent cli = new DefaultXmlRpcClientComponent(); 23 Vector v = new Vector (); 24 v.add("Pacman JVM"); v.add("PAC1"); v.add("Administrator"); v.add("Prueba pruebilla"); v.add(new Integer (1)); Vector vRdo = (Vector )cli.executeRpc(new URL ("http://localhost:12345/simple"), "simple.addComment", v); 30 System.out.println("The call was successful: " + (vRdo.size()==1)); 31 System.out.println("The comment was added: " + vRdo.get(0)); 32 } 33 34 public static void main(String args[]) 35 { 36 SimpleHandlerClient shc = new SimpleHandlerClient(); 37 try 38 { 39 shc.testXmlRpc(); 40 } 41 catch (Exception e) 42 { 43 System.err.println("Error invoking service: " + e); 44 } 45 } 46 } | Popular Tags |