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();
}
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);
}
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;
}
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);
}
}
}
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);
}
Aggregations