Class endPointClass = classLoader.loadClass(endpointClassName);
JavaClassToDBCConverter converter = new JavaClassToDBCConverter(endPointClass);
HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
DescriptionBuilderComposite dbc = dbcMap.get(endpointClassName);
dbc.setClassLoader(classLoader);
dbc.setWsdlDefinition(wsdlDefinition);
dbc.setClassName(endpointClassName);
dbc.setCustomWsdlGenerator(new WSDLGeneratorImpl(wsdlDefinition));
if (dbc.getWebServiceAnnot() != null) { //information specified in .wsdl should overwrite annotation.
WebServiceAnnot serviceAnnot = dbc.getWebServiceAnnot();
serviceAnnot.setPortName(portName);
serviceAnnot.setServiceName(service.getName());
serviceAnnot.setTargetNamespace(service.getTargetNamespace());
} else if (dbc.getWebServiceProviderAnnot() != null) {
//TODO: can webservice and webservice provider annot co-exist?
WebServiceProviderAnnot serviceProviderAnnot = dbc.getWebServiceProviderAnnot();
serviceProviderAnnot.setPortName(portName);
serviceProviderAnnot.setServiceName(service.getName());
serviceProviderAnnot.setTargetNamespace(service.getTargetNamespace());
}
for(Iterator<AxisOperation> opIterator = service.getOperations() ; opIterator.hasNext() ;){
AxisOperation operation = opIterator.next();
operation.setMessageReceiver(JAXWSMessageReceiver.class.newInstance());
String MEP = operation.getMessageExchangePattern();
if (!WSDLUtil.isOutputPresentForMEP(MEP)) {
List<MethodDescriptionComposite> mdcList = dbc.getMethodDescriptionComposite(operation.getName().toString());
for(Iterator<MethodDescriptionComposite> mIterator = mdcList.iterator(); mIterator.hasNext();){
MethodDescriptionComposite mdc = mIterator.next();
//TODO: JAXWS spec says need to check Holder param exist before taking a method as OneWay
mdc.setOneWayAnnot(true);
}