use of javax.xml.ws.Service 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 javax.xml.ws.Service 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 javax.xml.ws.Service 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 javax.xml.ws.Service 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);
}
use of javax.xml.ws.Service in project cxf by apache.
the class DifferentRealmTest method testUnknownRealm.
/**
* In this test, a token is issued by the first STS in realm "C". The second STS is not
* configured to trust realm "C" (via a cert constraint) and so authentication does not succeed.
*/
@org.junit.Test
public void testUnknownRealm() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = DifferentRealmTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = DifferentRealmTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItRealmCPort");
DoubleItPortType transportPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportPort, PORT);
// Transport port
try {
doubleIt(transportPort, 25);
} catch (Exception ex) {
// expected
}
((java.io.Closeable) transportPort).close();
bus.shutdown(true);
}
Aggregations