private NoMetadataModelInfo createNoMetadataModelInfo
(ServiceReferenceDescriptor serviceRef,
JaxrpcMappingDescriptor mappingDesc) throws Exception {
NoMetadataModelInfo modelInfo = rpcFactory.createNoMetadataModelInfo();
URL wsdlFile = serviceRef.hasWsdlOverride() ?
serviceRef.getWsdlOverride() : serviceRef.getWsdlFileUrl();
modelInfo.setLocation(wsdlFile.toExternalForm());
// Service endpoint interface is required. Parse generated
// service interface for it since we can't count on SEI
// having been listed in standard deployment information.
WsUtil wsUtil = new WsUtil();
String serviceInterfaceName = serviceRef.getServiceInterface();
ClassLoader cl = context.getModuleMetaData(Application.class).getClassLoader();
if (cl instanceof ASURLClassLoader) {
String modClassPath = ASClassLoaderUtil.getModuleClassPath(habitat, context);
List<URL> moduleList = ASClassLoaderUtil.getURLsFromClasspath(modClassPath, File.pathSeparator, null);
for (Iterator<URL> itr=moduleList.iterator();itr.hasNext();) {
((ASURLClassLoader) cl).appendURL(itr.next());
}
}
Class serviceInterface = cl.loadClass(serviceInterfaceName);
Collection seis = wsUtil.getSEIsFromGeneratedService(serviceInterface);
if( seis.size() == 0 ) {
throw new Exception("Invalid Generated Service Interface "
+ serviceInterfaceName + " . ");
} else if( seis.size() > 1 ) {
throw new Exception("Deployment error : If no " +
"jaxrpc-mapping file is provided, " +
"Generated Service Interface must have"
+" only 1 Service Endpoint Interface");
}
String serviceEndpointInterface = (String) seis.iterator().next();
modelInfo.setInterfaceName(serviceEndpointInterface);
addNamespaceMappingRegistry(modelInfo, mappingDesc);
return modelInfo;
}