use of org.example.schema.doubleit.DoubleIt in project cxf by apache.
the class SecurityPolicyTest method testCXF4119.
@Test
public void testCXF4119() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus();
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = SecurityPolicyTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
DoubleItPortTypeHeader pt;
QName portQName = new QName(NAMESPACE, "DoubleItPortCXF4119");
pt = service.getPort(portQName, DoubleItPortTypeHeader.class);
updateAddressPort(pt, PORT);
((BindingProvider) pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
((BindingProvider) pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES, "alice.properties");
((BindingProvider) pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, "revocation.properties");
((BindingProvider) pt).getRequestContext().put(SecurityConstants.ENABLE_REVOCATION, "true");
DoubleIt di = new DoubleIt();
di.setNumberToDouble(5);
try {
pt.doubleIt(di, 1);
fail("Failure expected on a revoked certificate");
} catch (Exception ex) {
// expected
}
((java.io.Closeable) pt).close();
bus.shutdown(true);
}
use of org.example.schema.doubleit.DoubleIt in project cxf by apache.
the class SecurityPolicyTest method testCXF3452.
@Test
public void testCXF3452() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus();
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = SecurityPolicyTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
DoubleItPortTypeHeader pt;
QName portQName = new QName(NAMESPACE, "DoubleItPortCXF3452");
pt = service.getPort(portQName, DoubleItPortTypeHeader.class);
updateAddressPort(pt, PORT);
((BindingProvider) pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
((BindingProvider) pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES, "alice.properties");
((BindingProvider) pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, "alice.properties");
DoubleIt di = new DoubleIt();
di.setNumberToDouble(5);
assertEquals(10, pt.doubleIt(di, 1).getDoubledNumber());
((java.io.Closeable) pt).close();
bus.shutdown(true);
}
Aggregations