Search in sources :

Example 21 with DoubleItPortType

use of org.example.contract.doubleit.DoubleItPortType in project cxf by apache.

the class Soap12Test method testSAML2.

@org.junit.Test
public void testSAML2() throws Exception {
    SpringBusFactory bf = new SpringBusFactory();
    URL busFile = Soap12Test.class.getResource("cxf-client.xml");
    Bus bus = bf.createBus(busFile.toString());
    BusFactory.setDefaultBus(bus);
    BusFactory.setThreadDefaultBus(bus);
    URL wsdl = Soap12Test.class.getResource("DoubleIt.wsdl");
    Service service = Service.create(wsdl, SERVICE_QNAME);
    QName portQName = new QName(NAMESPACE, "DoubleItTransportSAML2Port");
    DoubleItPortType transportSaml2Port = service.getPort(portQName, DoubleItPortType.class);
    updateAddressPort(transportSaml2Port, test.getPort());
    TokenTestUtils.updateSTSPort((BindingProvider) transportSaml2Port, test.getStsPort());
    if (test.isStreaming()) {
        SecurityTestUtil.enableStreaming(transportSaml2Port);
    }
    doubleIt(transportSaml2Port, 30);
    ((java.io.Closeable) transportSaml2Port).close();
    bus.shutdown(true);
}
Also used : Bus(org.apache.cxf.Bus) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) DoubleItPortType(org.example.contract.doubleit.DoubleItPortType) URL(java.net.URL)

Example 22 with DoubleItPortType

use of org.example.contract.doubleit.DoubleItPortType 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);
}
Also used : Bus(org.apache.cxf.Bus) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) DoubleItPortType(org.example.contract.doubleit.DoubleItPortType) URL(java.net.URL)

Example 23 with DoubleItPortType

use of org.example.contract.doubleit.DoubleItPortType 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);
}
Also used : Bus(org.apache.cxf.Bus) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) DoubleItPortType(org.example.contract.doubleit.DoubleItPortType) URL(java.net.URL)

Example 24 with DoubleItPortType

use of org.example.contract.doubleit.DoubleItPortType 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);
}
Also used : Bus(org.apache.cxf.Bus) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) DoubleItPortType(org.example.contract.doubleit.DoubleItPortType) URL(java.net.URL)

Example 25 with DoubleItPortType

use of org.example.contract.doubleit.DoubleItPortType 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);
}
Also used : Bus(org.apache.cxf.Bus) SpringBusFactory(org.apache.cxf.bus.spring.SpringBusFactory) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) DoubleItPortType(org.example.contract.doubleit.DoubleItPortType) URL(java.net.URL)

Aggregations

URL (java.net.URL)360 QName (javax.xml.namespace.QName)360 Service (javax.xml.ws.Service)360 DoubleItPortType (org.example.contract.doubleit.DoubleItPortType)360 Bus (org.apache.cxf.Bus)354 SpringBusFactory (org.apache.cxf.bus.spring.SpringBusFactory)352 SamlCallbackHandler (org.apache.cxf.systest.ws.saml.client.SamlCallbackHandler)31 Client (org.apache.cxf.endpoint.Client)22 STSClient (org.apache.cxf.ws.security.trust.STSClient)21 HashMap (java.util.HashMap)20 BindingProvider (javax.xml.ws.BindingProvider)17 WSS4JOutInterceptor (org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor)15 WSS4JStaxOutInterceptor (org.apache.cxf.ws.security.wss4j.WSS4JStaxOutInterceptor)13 KeystorePasswordCallback (org.apache.cxf.systest.ws.common.KeystorePasswordCallback)9 Test (org.junit.Test)9 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)8 BusException (org.apache.cxf.BusException)8 EndpointException (org.apache.cxf.endpoint.EndpointException)8 TokenStore (org.apache.cxf.ws.security.tokenstore.TokenStore)8 WebService (javax.jws.WebService)5