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));
dbc.setCatalogManager(catalogManager);
if (dbc.getWebServiceAnnot() != null) { //information specified in .wsdl should overwrite annotation.
WebServiceAnnot serviceAnnot = dbc.getWebServiceAnnot();
serviceAnnot.setPortName(portQName.getLocalPart());
serviceAnnot.setServiceName(serviceQName.getLocalPart());
serviceAnnot.setTargetNamespace(serviceQName.getNamespaceURI());
processServiceBinding(dbc, protocolBinding);
} else if (dbc.getWebServiceProviderAnnot() != null) {
WebServiceProviderAnnot serviceProviderAnnot = dbc.getWebServiceProviderAnnot();
serviceProviderAnnot.setPortName(portQName.getLocalPart());
serviceProviderAnnot.setServiceName(serviceQName.getLocalPart());
serviceProviderAnnot.setTargetNamespace(serviceQName.getNamespaceURI());
processServiceBinding(dbc, protocolBinding);
}
EndpointDescription endpointDescription = getEndpointDescription(dbcMap, endpointClassName);
//The portInfo is a mixed content of the annotations and webservices.xml file, currently, we have no way to pass the final portInfo
//to Axis2, so reconfigure those web service features in the endpoint description here.
configureWebServiceFeatures(endpointDescription, portInfo);
AxisService service = endpointDescription.getAxisService();
service.setName(serviceQName.getLocalPart());
service.setEndpointName(portQName.getLocalPart());
for(Iterator<AxisOperation> opIterator = service.getOperations() ; opIterator.hasNext() ;){
AxisOperation operation = opIterator.next();
operation.setMessageReceiver(this.messageReceiver);
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);
}