use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.
the class CustomOnBehalfOfTest method testUsernameOnBehalfOfLocal.
@org.junit.Test
public void testUsernameOnBehalfOfLocal() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = CustomOnBehalfOfTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = CustomOnBehalfOfTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportCustomBSTLocalPort");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
// Transport port
((BindingProvider) transportPort).getRequestContext().put(SecurityConstants.USERNAME, "alice");
doubleIt(transportPort, 25);
((java.io.Closeable) transportPort).close();
bus.shutdown(true);
}
use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.
the class CustomOnBehalfOfTest method testUsernameOnBehalfOfSTS.
@org.junit.Test
public void testUsernameOnBehalfOfSTS() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = CustomOnBehalfOfTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = CustomOnBehalfOfTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportCustomBSTPort");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
// Transport port
((BindingProvider) transportPort).getRequestContext().put(SecurityConstants.USERNAME, "alice");
doubleIt(transportPort, 25);
((java.io.Closeable) transportPort).close();
bus.shutdown(true);
}
use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.
the class DistributedCachingTest method testSAMLToken.
@org.junit.Test
public void testSAMLToken() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = DistributedCachingTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = DistributedCachingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItSAMLPort");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
// Transport port
doubleIt(transportPort, 25);
((java.io.Closeable) transportPort).close();
bus.shutdown(true);
}
use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.
the class DistributedCachingTest method testUsernameToken.
@org.junit.Test
public void testUsernameToken() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = DistributedCachingTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = DistributedCachingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItUsernameTokenPort");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
// Transport port
doubleIt(transportPort, 25);
((java.io.Closeable) transportPort).close();
bus.shutdown(true);
}
use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.
the class DistributedCachingTest method testSecurityContextToken.
@org.junit.Test
public void testSecurityContextToken() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = DistributedCachingTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = DistributedCachingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItSCTPort");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
// Transport port
doubleIt(transportPort, 25);
((java.io.Closeable) transportPort).close();
bus.shutdown(true);
}
Aggregations