public void testKeyIdentifierJaxwsClient() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = X509TokenTest.class.getResource("client/jaxws-client.xml");
Bus bus = bf.createBus(busFile.toString());
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
URL wsdl = X509TokenTest.class.getResource("DoubleItX509.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItKeyIdentifierPort");
DoubleItPortType x509Port =
service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(x509Port, PORT);
((BindingProvider)x509Port).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES,
"org/apache/cxf/systest/ws/wssec10/client/bob.properties");
((BindingProvider)x509Port).getRequestContext().put(SecurityConstants.ENCRYPT_USERNAME, "bob");
x509Port.doubleIt(25);
((java.io.Closeable)x509Port).close();
bus.shutdown(true);
}