public POJOEndpoint(Bus bus,
URL configurationBaseUrl,
Class instance) {
super(bus, instance);
implInfo = new GeronimoJaxWsImplementorInfo(instance, this.portInfo, instance.getClassLoader());
serviceFactory = new JaxWsServiceFactoryBean(implInfo);
serviceFactory.setBus(bus);
String wsdlLocation = null;
if (this.portInfo.getWsdlFile() != null) {
wsdlLocation = this.portInfo.getWsdlFile();
} else {
wsdlLocation = implInfo.getWsdlLocation();
}
URL wsdlURL = getWsdlURL(configurationBaseUrl, wsdlLocation);
// install as first to overwrite annotations (wsdl-file, wsdl-port, wsdl-service)
CXFServiceConfiguration configuration =
new CXFServiceConfiguration(this.portInfo, wsdlURL);
serviceFactory.getConfigurations().add(0, configuration);
service = serviceFactory.create();
this.holder = bus.getExtension(AnnotationHolder.class);
Context context = bus.getExtension(Context.class);
// instantiate and inject resources into service
try {
this.implementor = this.holder.newInstance(instance.getName(),
instance.getClassLoader(),
context);
} catch (Exception e) {
throw new WebServiceException("Service resource injection failed", e);
}
service.setInvoker(new JAXWSMethodInvoker(this.implementor));
JNDIResolver jndiResolver = (JNDIResolver) bus.getExtension(JNDIResolver.class);
this.annotationProcessor = new JAXWSAnnotationProcessor(jndiResolver, new WebServiceContextImpl());
}
|