1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| try {
Call call = (Call)new Service().createCall();
String endpoint = "http://localhost:8080/axis2/services/Hello";
call.setTargetEndpointAddress(endpoint);
call.setProperty(Call.SOAPACTION_USE_PROPERTY, true);
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://localhost:8080/Hello/sayHello");
call.setOperationName("sayHello");
call.addParameter("name", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
String name = "Christophe";
String message = (String)call.invoke(new Object [] {name});
System.out.println(message);
} catch(RemoteException e) {
e.printStackTrace();
} catch(ServiceException e) {
e.printStackTrace();
} |
Partager