use of javax.xml.ws.Service in project cxf by apache.
the class STSSenderVouchesTest method testSAML2SenderVouches.
@org.junit.Test
public void testSAML2SenderVouches() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = STSSenderVouchesTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = STSSenderVouchesTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2Port");
DoubleItPortType port = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(port, test.getPort());
TokenTestUtils.updateSTSPort((BindingProvider) port, test.getStsPort());
if (test.isStreaming()) {
SecurityTestUtil.enableStreaming(port);
}
doubleIt(port, 25);
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of javax.xml.ws.Service in project cxf by apache.
the class TransformationTest method testTokenTransformationClaims.
@org.junit.Test
public void testTokenTransformationClaims() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = TransformationTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = TransformationTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportUTClaimsPort");
DoubleItPortType transportUTPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportUTPort, PORT);
doubleIt(transportUTPort, 25);
((java.io.Closeable) transportUTPort).close();
bus.shutdown(true);
}
use of javax.xml.ws.Service in project cxf by apache.
the class TransformationTest method testTokenTransformation.
@org.junit.Test
public void testTokenTransformation() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = TransformationTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = TransformationTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportUTPort");
DoubleItPortType transportUTPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportUTPort, PORT);
doubleIt(transportUTPort, 25);
((java.io.Closeable) transportUTPort).close();
bus.shutdown(true);
}
use of javax.xml.ws.Service in project cxf by apache.
the class UsernameTokenTest method testUsernameTokenAuthorization.
@org.junit.Test
public void testUsernameTokenAuthorization() throws Exception {
// Token transformation is not supported for the streaming code
if (STAX_PORT.equals(test.getPort())) {
return;
}
SpringBusFactory bf = new SpringBusFactory();
URL busFile = UsernameTokenTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = UsernameTokenTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItTransportUTAuthorizationPort");
DoubleItPortType transportUTPort = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(transportUTPort, test.getPort());
if (test.isStreaming()) {
SecurityTestUtil.enableStreaming(transportUTPort);
}
doubleIt(transportUTPort, 25);
((java.io.Closeable) transportUTPort).close();
bus.shutdown(true);
}
use of javax.xml.ws.Service in project cxf by apache.
the class AsymmetricBindingTest method testUsernameTokenSAML2KeyValue.
@org.junit.Test
public void testUsernameTokenSAML2KeyValue() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = AsymmetricBindingTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = AsymmetricBindingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2KeyValuePort");
DoubleItPortType asymmetricSaml2Port = service.getPort(portQName, DoubleItPortType.class);
updateAddressPort(asymmetricSaml2Port, test.getPort());
TokenTestUtils.updateSTSPort((BindingProvider) asymmetricSaml2Port, test.getStsPort());
if (test.isStreaming()) {
SecurityTestUtil.enableStreaming(asymmetricSaml2Port);
}
doubleIt(asymmetricSaml2Port, 30);
TokenTestUtils.verifyToken(asymmetricSaml2Port);
((java.io.Closeable) asymmetricSaml2Port).close();
bus.shutdown(true);
}
Aggregations