}
checkWebMethodUseClass(clz.getSuperclass());
}
private void populateWSDLInfo(Class clazz) {
WebService webService = AnnotationUtil.getPrivClassAnnotation(clazz, WebService.class);
if (webService == null) {
Message message = new Message("SEI_CLASS_NO_WEBSERVICE_ANNOTATED", LOG);
throw new ToolException(message);
}
if (webService.endpointInterface().length() > 0) {
clazz = AnnotationUtil.loadClass(webService.endpointInterface(), clazz.getClassLoader());
webService = AnnotationUtil.getPrivClassAnnotation(clazz, WebService.class);
if (webService == null) {
Message message = new Message("SEI_INTERFACE_NO_WEBSERVICE_ANNOTATED", LOG);
throw new ToolException(message);
}
}
String portTypeName = clazz.getSimpleName() + "PortType";
if (webService.name().length() > 0) {
portTypeName = webService.name();
}
model.setPortTypeName(portTypeName);
String portName = clazz.getSimpleName() + "Port";
if (webService.portName().length() > 0) {
portName = webService.portName();
} else if (webService.name().length() > 0) {
portName = webService.name() + "Port";
}
model.setPortName(portName);
String serviceName = clazz.getSimpleName() + "Service";
if (env.optionSet(ToolConstants.CFG_SERVICENAME)) {
serviceName = (String)env.get(ToolConstants.CFG_SERVICENAME);
} else {
if (webService.serviceName().length() > 0) {
serviceName = webService.serviceName();
}
}
model.setServiceName(serviceName);
String packageName = "";
if (clazz.getPackage() != null) {
packageName = clazz.getPackage().getName();
}
model.setPackageName(packageName);
String targetNamespace = URIParserUtil.getNamespace(packageName);
if (env.optionSet(ToolConstants.CFG_TNS)) {
targetNamespace = (String)env.get(ToolConstants.CFG_TNS);
} else if (webService.targetNamespace().length() > 0) {
targetNamespace = webService.targetNamespace();
} else if (targetNamespace == null) {
Message message = new Message("SEI_CLASS_HASNO_PACKAGE", LOG);
throw new ToolException(message);
}
model.setTargetNameSpace(targetNamespace);
String wsdlLocation = webService.wsdlLocation();
model.setWsdllocation(wsdlLocation);
javax.jws.soap.SOAPBinding soapBinding = AnnotationUtil
.getPrivClassAnnotation(clazz, javax.jws.soap.SOAPBinding.class);
if (soapBinding != null) {