Search in sources :

Example 1 with ClientConfig

use of org.jboss.wsf.spi.metadata.config.ClientConfig in project jbossws-cxf by jbossws.

the class TestUtils method removeTestCaseClientConfiguration.

public static void removeTestCaseClientConfiguration(String testConfigName) {
    ServerConfig sc = getServerConfig();
    sc.unregisterClientConfig(new ClientConfig(testConfigName, null, null, null, null));
    sc.reloadClientConfigs();
}
Also used : ServerConfig(org.jboss.wsf.spi.management.ServerConfig) ClientConfig(org.jboss.wsf.spi.metadata.config.ClientConfig)

Example 2 with ClientConfig

use of org.jboss.wsf.spi.metadata.config.ClientConfig in project jbossws-cxf by jbossws.

the class TestUtils method changeDefaultClientConfiguration.

public static void changeDefaultClientConfiguration() {
    UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData("org.jboss.test.ws.jaxws.clientConfig.LogHandler", "Log Handler", null, null, null, null);
    UnifiedHandlerChainMetaData uhcmd = new UnifiedHandlerChainMetaData(null, null, null, Collections.singletonList(handler), false, null);
    List<UnifiedHandlerChainMetaData> postHC = Collections.singletonList(uhcmd);
    ClientConfig newDefaultClientConfig = new ClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG, null, postHC, null, null);
    setClientConfigAndReload(newDefaultClientConfig);
}
Also used : UnifiedHandlerMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData) UnifiedHandlerChainMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData) ClientConfig(org.jboss.wsf.spi.metadata.config.ClientConfig)

Example 3 with ClientConfig

use of org.jboss.wsf.spi.metadata.config.ClientConfig in project jbossws-cxf by jbossws.

the class TestUtils method getAndVerifyDefaultClientConfiguration.

public static ClientConfig getAndVerifyDefaultClientConfiguration() throws Exception {
    ServerConfig sc = getServerConfig();
    ClientConfig defaultConfig = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
    if (defaultConfig == null) {
        throw new Exception("Missing AS client config '" + ClientConfig.STANDARD_CLIENT_CONFIG + "'!");
    }
    List<UnifiedHandlerChainMetaData> preHC = defaultConfig.getPreHandlerChains();
    List<UnifiedHandlerChainMetaData> postHC = defaultConfig.getPostHandlerChains();
    if ((preHC != null && !preHC.isEmpty()) || (postHC != null && !postHC.isEmpty())) {
        throw new Exception("'" + ClientConfig.STANDARD_CLIENT_CONFIG + "' is not empty!");
    }
    return defaultConfig;
}
Also used : ServerConfig(org.jboss.wsf.spi.management.ServerConfig) UnifiedHandlerChainMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData) ClientConfig(org.jboss.wsf.spi.metadata.config.ClientConfig)

Example 4 with ClientConfig

use of org.jboss.wsf.spi.metadata.config.ClientConfig in project jbossws-cxf by jbossws.

the class CXFClientConfigurerTest method testSetConfigProperties.

@Test
public void testSetConfigProperties() throws Exception {
    Bus bus = null;
    try {
        bus = BusFactory.newInstance().createBus();
        BusFactory.setThreadDefaultBus(bus);
        Service service = Service.create(this.getClass().getResource("META-INF/TestService.wsdl"), new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointService"));
        EndpointInterface port = service.getPort(new QName("http://www.openuri.org/2004/04/HelloWorld", "EndpointInterfacePort"), EndpointInterface.class);
        Client client = ClientProxy.getClient(port);
        Map<String, String> properties = new HashMap<String, String>();
        properties.put("A", "1");
        properties.put("B", "2");
        properties.put("C", "3");
        properties.put("D", "4");
        properties.put("E", "5");
        ClientConfig clientConfig = new ClientConfig("Foo", null, null, properties, null);
        CXFClientConfigurer cfg = new CXFClientConfigurer();
        cfg.setConfigProperties(port, clientConfig);
        assertEquals("1", client.getEndpoint().get("A"));
        assertEquals("2", client.getEndpoint().get("B"));
        assertEquals("3", client.getEndpoint().get("C"));
        assertEquals("4", client.getEndpoint().get("D"));
        assertEquals("5", client.getEndpoint().get("E"));
        properties = new HashMap<String, String>();
        properties.put("E", "10");
        properties.put("F", "20");
        properties.put("G", "30");
        clientConfig = new ClientConfig("Foo2", null, null, properties, null);
        cfg.setConfigProperties(port, clientConfig);
        assertEquals(null, client.getEndpoint().get("A"));
        assertEquals(null, client.getEndpoint().get("B"));
        assertEquals(null, client.getEndpoint().get("C"));
        assertEquals(null, client.getEndpoint().get("D"));
        assertEquals("10", client.getEndpoint().get("E"));
        assertEquals("20", client.getEndpoint().get("F"));
        assertEquals("30", client.getEndpoint().get("G"));
    } finally {
        if (bus != null) {
            bus.shutdown(true);
        }
    }
}
Also used : Bus(org.apache.cxf.Bus) HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) Client(org.apache.cxf.endpoint.Client) ClientConfig(org.jboss.wsf.spi.metadata.config.ClientConfig) Test(org.junit.Test)

Example 5 with ClientConfig

use of org.jboss.wsf.spi.metadata.config.ClientConfig in project jbossws-cxf by jbossws.

the class CXFClientConfigurer method setConfigProperties.

@Override
public void setConfigProperties(Object client, String configFile, String configName) {
    Class<?> clazz = !(client instanceof Dispatch) ? client.getClass() : null;
    ClientConfig config = readConfig(configFile, configName, clazz);
    setConfigProperties(client, config);
}
Also used : Dispatch(javax.xml.ws.Dispatch) ClientConfig(org.jboss.wsf.spi.metadata.config.ClientConfig)

Aggregations

ClientConfig (org.jboss.wsf.spi.metadata.config.ClientConfig)19 Service (javax.xml.ws.Service)7 HashMap (java.util.HashMap)6 UnifiedHandlerChainMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData)6 URL (java.net.URL)5 QName (javax.xml.namespace.QName)5 ServerConfig (org.jboss.wsf.spi.management.ServerConfig)5 EndpointConfig (org.jboss.wsf.spi.metadata.config.EndpointConfig)3 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)2 BindingProvider (javax.xml.ws.BindingProvider)2 Handler (javax.xml.ws.handler.Handler)2 Bus (org.apache.cxf.Bus)2 Client (org.apache.cxf.endpoint.Client)2 UnifiedHandlerMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData)2 LinkedList (java.util.LinkedList)1 SOAPMessage (javax.xml.soap.SOAPMessage)1 Source (javax.xml.transform.Source)1 DOMSource (javax.xml.transform.dom.DOMSource)1 Dispatch (javax.xml.ws.Dispatch)1