Service serviceModel = new ObjectServiceFactory().create(IBook.class,
"BookService",
SERVICE_NAMESPACE,
null);
IBook service = (IBook) new XFireProxyFactory().create(serviceModel, SERVICE_URL
+ serviceName);
Client client = Client.getInstance(service);
// Client client = ((XFireProxy) Proxy.getInvocationHandler(service)).getClient();
client.addOutHandler(new DOMOutHandler());
Properties outProperties = new Properties();
configureOutProperties(outProperties);
client.addOutHandler(new WSS4JOutHandler(outProperties));
// Configure incoming secuirty
client.addInHandler(new DOMInHandler());
Properties inProperties = new Properties();
configureInProperties(inProperties);
client.addInHandler(new WSS4JInHandler(inProperties));
System.out.print("Looking for isbn : 0123456789 ....");
Book b = service.findBook("0123456789");
System.out.print(b.getTitle() + " : " + b.getAuthor() + "\n");
}