// Create the client
JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
proxyFac.setAddress("http://localhost:" + PORT + "/jaxws/addmex");
proxyFac.getFeatures().add(new LoggingFeature());
MetadataExchange exc = proxyFac.create(MetadataExchange.class);
Metadata metadata = exc.get2004();
assertNotNull(metadata);
assertEquals(2, metadata.getMetadataSection().size());
assertEquals("http://schemas.xmlsoap.org/wsdl/",
metadata.getMetadataSection().get(0).getDialect());
assertEquals("http://apache.org/cxf/systest/ws/addr_feature/",
metadata.getMetadataSection().get(0).getIdentifier());
assertEquals("http://www.w3.org/2001/XMLSchema",
metadata.getMetadataSection().get(1).getDialect());
GetMetadata body = new GetMetadata();
body.setDialect("http://www.w3.org/2001/XMLSchema");
metadata = exc.getMetadata(body);
assertEquals(1, metadata.getMetadataSection().size());
assertEquals("http://www.w3.org/2001/XMLSchema",
metadata.getMetadataSection().get(0).getDialect());
}