Search in sources :

Example 1 with UseNewBusFeature

use of org.jboss.wsf.stack.cxf.client.UseNewBusFeature in project wildfly by wildfly.

the class ReliableServiceTestCase method consumeOneWayService.

private void consumeOneWayService() throws Exception {
    QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsrm", "ReliableService");
    URL wsdlURL = new URL(baseUrl, "ReliableService?wsdl");
    Service service = Service.create(wsdlURL, serviceName, new UseNewBusFeature());
    ReliableService proxy = (ReliableService) service.getPort(ReliableService.class);
    BindingProvider bp = (BindingProvider) proxy;
    bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, new URL(baseUrl, "ReliableService").toString());
    proxy.writeLogMessage();
}
Also used : QName(javax.xml.namespace.QName) UseNewBusFeature(org.jboss.wsf.stack.cxf.client.UseNewBusFeature) ReliableService(org.jboss.as.test.integration.ws.wsrm.generated.ReliableService) ReliableService(org.jboss.as.test.integration.ws.wsrm.generated.ReliableService) Service(javax.xml.ws.Service) BindingProvider(javax.xml.ws.BindingProvider) URL(java.net.URL)

Example 2 with UseNewBusFeature

use of org.jboss.wsf.stack.cxf.client.UseNewBusFeature in project wildfly by wildfly.

the class EJBSignEncryptMultipleClientsTestCase method encryptedAndSignedRequestFromAlice.

@Test
public void encryptedAndSignedRequestFromAlice() throws Exception {
    QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "EJBEncryptSecurityService");
    URL wsdlURL = new URL(baseUrl, "/jaxws-wsse-sign-encrypt-mc/EJBEncryptSecurityService?wsdl");
    //use a new bus to avoid any possible clash with other tests
    Service service = Service.create(wsdlURL, serviceName, new UseNewBusFeature());
    ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
    setupWsse(proxy, "alice");
    Assert.assertEquals("Secure Hello World!", proxy.sayHello());
}
Also used : ServiceIface(org.jboss.as.test.integration.ws.wsse.ServiceIface) QName(javax.xml.namespace.QName) UseNewBusFeature(org.jboss.wsf.stack.cxf.client.UseNewBusFeature) Service(javax.xml.ws.Service) URL(java.net.URL) Test(org.junit.Test)

Example 3 with UseNewBusFeature

use of org.jboss.wsf.stack.cxf.client.UseNewBusFeature in project wildfly by wildfly.

the class EJBSignEncryptMultipleClientsTestCase method encryptedAndSignedRequestFromUntrustedMax.

/*
     * Max's public key is not trusted in Bob's keystore
     * Max's keystore contain's Bob's public key as trusted.
     */
@Test
public void encryptedAndSignedRequestFromUntrustedMax() throws Exception {
    QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "EJBEncryptSecurityService");
    URL wsdlURL = new URL(baseUrl, "/jaxws-wsse-sign-encrypt-mc/EJBEncryptSecurityService?wsdl");
    //use a new bus to avoid any possible clash with other tests
    Service service = Service.create(wsdlURL, serviceName, new UseNewBusFeature());
    ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
    setupWsse(proxy, "max");
    try {
        proxy.sayHello();
        Assert.fail("Max shouldn't invoke this service");
    } catch (SOAPFaultException ex) {
    // expected failure because max isn't trusted
    }
}
Also used : ServiceIface(org.jboss.as.test.integration.ws.wsse.ServiceIface) QName(javax.xml.namespace.QName) UseNewBusFeature(org.jboss.wsf.stack.cxf.client.UseNewBusFeature) Service(javax.xml.ws.Service) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) URL(java.net.URL) Test(org.junit.Test)

Example 4 with UseNewBusFeature

use of org.jboss.wsf.stack.cxf.client.UseNewBusFeature in project wildfly by wildfly.

the class EJBSignEncryptMultipleClientsTestCase method encryptedAndSignedRequestFromJohn.

@Test
public void encryptedAndSignedRequestFromJohn() throws Exception {
    QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "EJBEncryptSecurityService");
    URL wsdlURL = new URL(baseUrl, "/jaxws-wsse-sign-encrypt-mc/EJBEncryptSecurityService?wsdl");
    //use a new bus to avoid any possible clash with other tests
    Service service = Service.create(wsdlURL, serviceName, new UseNewBusFeature());
    ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
    setupWsse(proxy, "john");
    Assert.assertEquals("Secure Hello World!", proxy.sayHello());
}
Also used : ServiceIface(org.jboss.as.test.integration.ws.wsse.ServiceIface) QName(javax.xml.namespace.QName) UseNewBusFeature(org.jboss.wsf.stack.cxf.client.UseNewBusFeature) Service(javax.xml.ws.Service) URL(java.net.URL) Test(org.junit.Test)

Example 5 with UseNewBusFeature

use of org.jboss.wsf.stack.cxf.client.UseNewBusFeature in project wildfly by wildfly.

the class SignEncryptMultipleClientsTestCase method encryptedAndSignedRequestFromJohn.

@Test
public void encryptedAndSignedRequestFromJohn() throws Exception {
    QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "EncryptSecurityService");
    URL wsdlURL = new URL(baseUrl.toString() + "EncryptSecurityService?wsdl");
    //use a new bus to avoid any possible clash with other tests
    Service service = Service.create(wsdlURL, serviceName, new UseNewBusFeature());
    ServiceIface proxy = (ServiceIface) service.getPort(ServiceIface.class);
    setupWsse(proxy, "john");
    Assert.assertEquals("Secure Hello World!", proxy.sayHello());
}
Also used : ServiceIface(org.jboss.as.test.integration.ws.wsse.ServiceIface) QName(javax.xml.namespace.QName) UseNewBusFeature(org.jboss.wsf.stack.cxf.client.UseNewBusFeature) Service(javax.xml.ws.Service) URL(java.net.URL) Test(org.junit.Test)

Aggregations

UseNewBusFeature (org.jboss.wsf.stack.cxf.client.UseNewBusFeature)11 URL (java.net.URL)10 QName (javax.xml.namespace.QName)10 Service (javax.xml.ws.Service)10 Test (org.junit.Test)9 ServiceIface (org.jboss.as.test.integration.ws.wsse.ServiceIface)8 BindingProvider (javax.xml.ws.BindingProvider)2 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)2 ReliableService (org.jboss.as.test.integration.ws.wsrm.generated.ReliableService)2 WebServiceException (javax.xml.ws.WebServiceException)1 Bus (org.apache.cxf.Bus)1 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)1 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)1 UseThreadBusFeature (org.jboss.wsf.stack.cxf.client.UseThreadBusFeature)1 JBossWSTest (org.jboss.wsf.test.JBossWSTest)1