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; public class ClientTimeNow { public static void main(String [] args) { try { // l'URI a contacter String endpointURL = "http://localhost:8080/TimeNowWS/web/TimeNow.jws"; // Le service à executer Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpointURL) ); // l'operation du service call.setOperationName( new QName("TimeNow", "getTimeNow") ); // L'appel String ret = (String) call.invoke( new Object[] { } ); System.out.println("Bonjour d'Autrans !! Ici, il est " + ret); } catch (Exception e) { System.err.println("erreur "+ e.toString()); } } }