* @throws WSDLException
*/
public static EndpointReferenceType getEndpointReference(WSDLManager manager,
Class<?> implementorClass) {
WebService ws = getWebServiceAnnotation(implementorClass);
WebServiceProvider wsp = null;
if (null == ws) {
wsp = implementorClass.getAnnotation(WebServiceProvider.class);
if (null == wsp) {
return null;
}
}
EndpointReferenceType reference = new EndpointReferenceType();
reference.setMetadata(new MetadataType());
String serviceName = (null != ws) ? ws.serviceName() : wsp.serviceName();
String targetNamespace = (null != ws) ? ws.targetNamespace() : wsp.targetNamespace();
String portName = (null != ws) ? ws.portName() : wsp.portName();
String url = (null != ws) ? ws.wsdlLocation() : wsp.wsdlLocation();
String className = (null != ws) ? ws.endpointInterface() : null;
QName portTypeName = null;
if (null != className && !"".equals(className)) {
Class<?> seiClazz = null;
try {
seiClazz = Class.forName(className);
} catch (ClassNotFoundException cnfe) {
LOG.log(Level.SEVERE, "SEI_LOAD_FAILURE_MSG", cnfe);
throw new WebServiceException("endpointInterface element in WebService annotation invalid",
cnfe);
}
if (!seiClazz.isInterface()) {
throw new WebServiceException("endpointInterface element does not refer to a java interface");
}
WebService seiws = seiClazz.getAnnotation(WebService.class);
if (null == seiws) {
throw new WebServiceException("SEI should have a WebService Annotation");
}
if ("".equals(url)) {
url = seiws.wsdlLocation();
}
//WebService.name maps to wsdl:portType name.
portTypeName = new QName(ws.targetNamespace(), seiws.name());
//ServiceName,portName,endpointInterface not allowed on the WebService annotation
// of a SEI, Section 3.2 JSR181.
// set interfaceName using WebService.targetNamespace of SEI only.
} else {