import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.XMLType; import org.apache.axis.utils.Options; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; public class ClientHelloTime { public static void main(String [] args) { try { // on attend un parametre Options options = new Options(args); String textToSend; args = options.getRemainingArgs(); if ((args == null) || (args.length < 1)) { textToSend = "l'inconnu"; } else { textToSend = args[0]; } // Le necessaire pour realiser l'appel : Service service = new Service(); Call call = (Call) service.createCall(); // L'URI du service a appeler String url = "http://127.0.0.1:8080/HelloTimeWS/web/HelloTime.jws"; call.setTargetEndpointAddress( new java.net.URL(url) ); // L'operation a executer avec ses parametres d'entree et de sortie call.setOperationName( new QName("HelloTime", "sayHelloWorldInParam") ); call.addParameter( "s", XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING ); // L'appel String ret = (String) call.invoke( new Object[] { textToSend } ); System.out.println(ret); } catch (Exception e) { System.err.println(e.toString()+" ici"); } } }