use of org.apache.cxf.ws.mex.model._2004_09.GetMetadata in project cxf by apache.
the class MEXTest method testGet.
@Test
public void testGet() {
// Create the client
JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
proxyFac.setBus(getStaticBus());
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());
}
Aggregations