service = getServiceFactory().create(Echo.class, "Echo", null, null);
service.setProperty(ObjectInvoker.SERVICE_IMPL_CLASS, EchoImpl.class);
service.addInHandler(new DOMInHandler());
service.addOutHandler(new DOMOutHandler());
wsIn = new WSS4JInHandler();
wsIn.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/xfire/insecurity.properties");
wsIn.setProperty(WSHandlerConstants.DEC_PROP_FILE, "META-INF/xfire/insecurity.properties");
wsIn.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
service.addInHandler(wsIn);
wsOut = new WSS4JOutHandler();
wsOut.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/xfire/outsecurity.properties");
wsOut.setProperty(WSHandlerConstants.ENC_PROP_FILE, "META-INF/xfire/outsecurity.properties");
wsOut.setProperty(WSHandlerConstants.USER, "myAlias");
wsOut.setProperty("password", "myAliasPassword");
wsOut.setProperty(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT);
wsOut.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
service.addOutHandler(wsOut);
getServiceRegistry().register(service);
// Create the client
XFireProxyFactory pFactory = new XFireProxyFactory(getXFire());
echo = (Echo) pFactory.create(service, "xfire.local://Echo");
client = ((XFireProxy) Proxy.getInvocationHandler(echo)).getClient();
client.addInHandler(wsIn);
client.addInHandler(new DOMInHandler());
client.addOutHandler(wsOut);
client.addOutHandler(new DOMOutHandler());
}