public static void main(String[] args) throws Exception {
if(args.length != 2) {
System.out.println("Usage: $java Client endpoint_address client_repo_path");
}
ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], args[1] + "/conf/axis2.xml");
ServiceClient client = new ServiceClient(ctx, null);
Options options = new Options();
options.setAction("urn:echo");
options.setTo(new EndpointReference(args[0]));
client.setOptions(options);
OMElement response = client.sendReceive(getPayload("Hello world"));
System.out.println(response);
}
|