Search in sources :

Example 1 with XMLWSDLExtensionLoader

use of org.apache.cxf.binding.xml.wsdl11.XMLWSDLExtensionLoader in project cxf by apache.

the class TestBase method common.

protected void common(String wsdl, QName portName, Class<?>... jaxbClasses) throws Exception {
    Bus bus = BusFactory.getDefaultBus();
    WSDLManagerImpl manager = new WSDLManagerImpl();
    XMLWSDLExtensionLoader loader = new XMLWSDLExtensionLoader(bus);
    loader.registerExtensors(manager);
    assertNotNull(bus.getExtension(WSDLManager.class));
    WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass().getResource(wsdl).toString(), new QName(portName.getNamespaceURI(), "XMLService"));
    org.apache.cxf.service.Service service = factory.create();
    EndpointInfo epi = service.getEndpointInfo(portName);
    assertNotNull(epi);
    serviceInfo = epi.getService();
    JAXBDataBinding db = new JAXBDataBinding();
    db.initialize(service);
    db.setContext(JAXBContext.newInstance(jaxbClasses));
    service.setDataBinding(db);
    Endpoint endpoint = new EndpointImpl(bus, service, epi);
    xmlMessage.getExchange().put(Endpoint.class, endpoint);
    xmlMessage.getExchange().put(org.apache.cxf.service.Service.class, service);
}
Also used : Bus(org.apache.cxf.Bus) WSDLServiceFactory(org.apache.cxf.wsdl11.WSDLServiceFactory) XMLWSDLExtensionLoader(org.apache.cxf.binding.xml.wsdl11.XMLWSDLExtensionLoader) QName(javax.xml.namespace.QName) EndpointImpl(org.apache.cxf.endpoint.EndpointImpl) WSDLManagerImpl(org.apache.cxf.wsdl11.WSDLManagerImpl) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) Endpoint(org.apache.cxf.endpoint.Endpoint) WSDLManager(org.apache.cxf.wsdl.WSDLManager) JAXBDataBinding(org.apache.cxf.jaxb.JAXBDataBinding)

Aggregations

QName (javax.xml.namespace.QName)1 Bus (org.apache.cxf.Bus)1 XMLWSDLExtensionLoader (org.apache.cxf.binding.xml.wsdl11.XMLWSDLExtensionLoader)1 Endpoint (org.apache.cxf.endpoint.Endpoint)1 EndpointImpl (org.apache.cxf.endpoint.EndpointImpl)1 JAXBDataBinding (org.apache.cxf.jaxb.JAXBDataBinding)1 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)1 WSDLManager (org.apache.cxf.wsdl.WSDLManager)1 WSDLManagerImpl (org.apache.cxf.wsdl11.WSDLManagerImpl)1 WSDLServiceFactory (org.apache.cxf.wsdl11.WSDLServiceFactory)1