throw new AnnotationProcessorException("SEI " + ((javax.jws.WebService) annInfo.getAnnotation()).endpointInterface()
+ " cannot have @BindingType");
}
}
WebServicesDescriptor wsDesc = bundleDesc.getWebServices();
//WebService.name not found; as per 109, default port-component-name
//is the simple class name as long as the simple class name will be a
// unique port-component-name for this module
if(portComponentName == null || portComponentName.length() == 0) {
portComponentName = implClassName;
}
// Check if this port-component-name is unique for this module
WebServiceEndpoint wep = wsDesc.getEndpointByName(portComponentName);
if(wep!=null) {
//there is another port-component by this name in this module;
//now we have to look at the SEI/impl of that port-component; if that SEI/impl
//is the same as the current SEI/impl then it means we have to override values;
//If the SEI/impl classes do not match, then no overriding should happen; we should
//use fully qualified class name as port-component-name for the current endpoint
if((wep.getServiceEndpointInterface() != null) &&
(wep.getServiceEndpointInterface().length() != 0) &&
(!((Class)annElem).getName().equals(wep.getServiceEndpointInterface()))) {
portComponentName = implClassFullName;
}
}
// Check if the same endpoint is already defined in webservices.xml
// This has to be done again after applying the 109 rules as above
// for port-component-name
WebServiceEndpoint endpoint = wsDesc.getEndpointByName(portComponentName);
WebService newWS;
if(endpoint == null) {
// Check if a service with the same name is already present
// If so, add this endpoint to the existing service
if (svcNameFromImplClass!=null && svcNameFromImplClass.length()!=0) {
newWS = wsDesc.getWebServiceByName(svcNameFromImplClass);
} else {
newWS = wsDesc.getWebServiceByName(implClassName+"Service");
}
if(newWS==null) {
newWS = new WebService();
// service name from annotation
if (svcNameFromImplClass!=null && svcNameFromImplClass.length()!=0) {
newWS.setName(svcNameFromImplClass);
} else {
newWS.setName(implClassName+"Service");
}
wsDesc.addWebService(newWS);
}
endpoint = new WebServiceEndpoint();
if (portComponentName!=null && portComponentName.length()!=0) {
endpoint.setEndpointName(portComponentName);
} else {
endpoint.setEndpointName(((Class) annElem).getName());
}
newWS.addEndpoint(endpoint);
wsDesc.setSpecVersion(com.sun.enterprise.deployment.node.WebServicesDescriptorNode.SPEC_VERSION);
} else {
newWS = endpoint.getWebService();
}
// If wsdl-service is specified in the descriptor, then the targetnamespace