//DocLitWrappedMinimum marshaller code. The advantage of normal DocLitWrappedMarshaller is
//that it is very robust and has support of lot more datatypes than in DocLitWrappedMinimum.
if(log.isDebugEnabled()){
log.debug("Adding cache to classpath");
}
ClassFinderFactory cff =
(ClassFinderFactory)FactoryRegistry.getFactory(ClassFinderFactory.class);
ClassFinder cf = cff.getClassFinder();
String cachePath = (String)serviceDesc.getAxisConfigContext().getProperty(Constants.WS_CACHE);
if(cachePath!=null){
//lets add the cache to classpath and retry loading missing artifacts.
if(log.isDebugEnabled()){
log.debug("updating classpath with cache location");
}
cf.updateClassPath(cachePath, cl);
if(log.isDebugEnabled()){
log.debug("trying to load class "+newValue+" from cache.");
}
cls=loadClassOrNull(newValue, cl);
if(cls!=null){
wrapperClass=newValue;
}
}
}
}
}
} else {
// If no value is provided by the annotation, then the we try default values.
// The wsgen tool generates classes in the jaxws subpackage.
// The wsimport tool generates classes in the same package as the SEI.
// Note that from reading the JAX-WS spec, it seems that WSGen is doing that
// correctly; See the conformance requirement in JAX-WS 2.0 Spec Section 3.6.2.1 Document
// Wrapped on page 36: Conformance (Default wrapper bean package): In the absence of
// customizations, the wrapper beans package MUST be a generated jaxws subpackage of the SEI
// package.
// However, if the class is in both places the runtime should prefer the one
// in the non-jaxws package. Why ?
// The other classes in the non-jaxws package will cause the non-jaxws
// wrapper to get pulled in first....thus the jaxws wrapper will cause a collision.
//
// Thus the following algorithm with check the non-jaxws package first
Class cls1 = null; // Class from the non-JAXWS package
Class cls2 = null; // Class from the JAX-WS package
boolean cls1IsJAXB = false;
boolean cls2IsJAXB = false;
// Look for the class in the non-jaxws package first
String defaultValue = null;
if (defaultPkg.length() > 0) {
defaultValue = defaultPkg + "." + defaultClassName;
} else {
defaultValue = defaultClassName;
}
if (log.isDebugEnabled()) {
log.debug("No provided value. Try the default class name = " + defaultValue);
}
cls1 = loadClassOrNull(defaultValue, cl);
if (cls1 == null) {
cls1 = loadClassOrNull(defaultValue, altClassLoader);
}
if (cls1 != null) {
cls1IsJAXB = isJAXB(cls1);
}
// Now try the one in the jaxws subpackage (if cls1 is missing or perhaps not a JAXB class)
if (cls1 == null || !cls1IsJAXB) {
if (defaultPkg.length() > 0) {
defaultValue = defaultPkg + "." + JAXWS_SUBPACKAGE + "." + defaultClassName;
if (log.isDebugEnabled()) {
log.debug("Did not find the default name. Try a different default class name = " + defaultValue);
}
cls2 = loadClassOrNull(defaultValue, cl);
if (cls2 == null) {
cls2 = loadClassOrNull(defaultValue, altClassLoader);
}
if(cls2==null &&
(type.equals("@RequestWrapper")|| type.equals("@ResponseWrapper")||type.equals("@WebFault")|| type.equals("faultInfo"))){
//Support for Fault Bean Generation
//As per JAX-WS 2.2 Specification section 3.7 an application programmer can choose not to
//package the faultBeans, if we have reached this point in the code then user has choosen
//not to package the fault bean. If there is a cache of generated artifacts available then
//lets look for the missing faultBean there.
//Support for Wrapper Bean Generation
//As per JAX-WS 2.2 Specificaiton section 3.6.2.1 pg 41 an application programmer does not use
//the wrapper bean classes, so the application need not package these classes. If we have reached
//this point in the code then user has choosen not to package these beans.
//NOTE:If we find Generated artifacts from cache this guarantees that we will not use
//DocLitWrappedMinimum marshaller code. The advantage of normal DocLitWrappedMarshaller is
//that it is very robust and has support of lot more datatypes than in DocLitWrappedMinimum.
if(log.isDebugEnabled()){
log.debug("Adding cache to classpath");
}
if(log.isDebugEnabled()){
log.debug("Adding cache to classpath");
}
ClassFinderFactory cff =
(ClassFinderFactory)FactoryRegistry.getFactory(ClassFinderFactory.class);
ClassFinder cf = cff.getClassFinder();
String cachePath = (String)serviceDesc.getAxisConfigContext().getProperty(Constants.WS_CACHE);
if(log.isDebugEnabled()){
log.debug("cachePath = "+cachePath);
}
if(cachePath!=null){