Search in sources :

Example 1 with GetMetadata

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());
}
Also used : GetMetadata(org.apache.cxf.ws.mex.model._2004_09.GetMetadata) LoggingFeature(org.apache.cxf.ext.logging.LoggingFeature) JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) Metadata(org.apache.cxf.ws.mex.model._2004_09.Metadata) GetMetadata(org.apache.cxf.ws.mex.model._2004_09.GetMetadata) MetadataExchange(org.apache.cxf.ws.mex.MetadataExchange) Test(org.junit.Test)

Aggregations

LoggingFeature (org.apache.cxf.ext.logging.LoggingFeature)1 JaxWsProxyFactoryBean (org.apache.cxf.jaxws.JaxWsProxyFactoryBean)1 MetadataExchange (org.apache.cxf.ws.mex.MetadataExchange)1 GetMetadata (org.apache.cxf.ws.mex.model._2004_09.GetMetadata)1 Metadata (org.apache.cxf.ws.mex.model._2004_09.Metadata)1 Test (org.junit.Test)1