use of org.example.contract.doubleit.DoubleItPortType2 in project cxf by apache.
the class X509TokenTest method testKeyIdentifier2.
@org.junit.Test
public void testKeyIdentifier2() throws Exception {
if (test.isStreaming()) {
return;
}
SpringBusFactory bf = new SpringBusFactory();
URL busFile = X509TokenTest.class.getResource("client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.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 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);
}
Aggregations