SpringBusFactory.setThreadDefaultBus(bus);
URL wsdl = X509TokenTest.class.getResource("DoubleItOperations.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItKeyIdentifierPort2");
DoubleItPortType2 x509Port =
service.getPort(portQName, DoubleItPortType2.class);
updateAddressPort(x509Port, PORT);
List<Header> headers = new ArrayList<Header>();
Header dummyHeader = new Header(new QName("uri:org.apache.cxf", "dummy"), "dummy-header",
new JAXBDataBinding(String.class));
headers.add(dummyHeader);
((BindingProvider)x509Port).getRequestContext().put(Header.HEADER_LIST, headers);
int response = x509Port.doubleIt(25);
assertEquals(50, response);
int response2 = x509Port.doubleIt2(15);
assertEquals(30, response2);
((java.io.Closeable)x509Port).close();
bus.shutdown(true);
}