}
if (wrapped != null) {
MessageContentsList objs = MessageContentsList.getContentsList(message);
WrapperHelper helper = parts.get(0).getProperty("WRAPPER_CLASS", WrapperHelper.class);
if (helper == null) {
Service service = ServiceModelUtil.getService(message.getExchange());
DataBinding dataBinding = service.getDataBinding();
if (dataBinding instanceof WrapperCapableDatabinding) {
helper = createWrapperHelper((WrapperCapableDatabinding)dataBinding,
messageInfo, wrappedMsgInfo, wrapped);
parts.get(0).setProperty("WRAPPER_CLASS", helper);
} else {
return;
}
}
try {
MessageContentsList newObjs = new MessageContentsList();
Object en = message.getContextualProperty(Message.SCHEMA_VALIDATION_ENABLED);
// set the validate option for XMLBeans Wrapper Helper
if (Boolean.TRUE.equals(en) || "true".equals(en)) {
try {
Class<?> xmlBeanWrapperHelperClass =
Class.forName("org.apache.cxf.xmlbeans.XmlBeansWrapperHelper");
if (xmlBeanWrapperHelperClass.isInstance(helper)) {
Method method = xmlBeanWrapperHelperClass.getMethod("setValidate", boolean.class);
method.invoke(helper, true);
}
} catch (Exception exception) {
// do nothing there
}
}
Object o2 = helper.createWrapperObject(objs);
newObjs.put(parts.get(0), o2);
for (MessagePartInfo p : messageInfo.getMessageParts()) {
if (Boolean.TRUE.equals(p.getProperty(ReflectionServiceFactoryBean.HEADER))) {
MessagePartInfo mpi = wrappedMsgInfo.getMessagePart(p.getName());