String nsuri = xmlType.getNamespaceURI();
Class componentType = javaType;
while (componentType.isArray())
componentType = componentType.getComponentType();
JavaToXSD javaToXSD = new JavaToXSD();
// Force all DII arrays to use the same array namespace for the component
if (! componentType.isPrimitive())
{
Map<String, String> namespaceMap = new HashMap<String, String>();
namespaceMap.put(componentType.getPackage().getName(), nsuri);
javaToXSD.setPackageNamespaceMap(namespaceMap);
}
JBossXSModel xsModel = javaToXSD.generateForSingleType(xmlType, javaType);
if (xsModel == null)
throw new WSException("Cannot generate XSModel");
if(log.isDebugEnabled()) log.debug("\n" + xsModel.serialize());
return xsModel;