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