JAXBType outJaxbType = getAttachmentType(mimeContents, part);
String inType = jaxbType.getJavaType().getType().getName();
String outType = outJaxbType.getJavaType().getType().getName();
TypeAndAnnotation inTa = jaxbType.getJavaType().getType().getTypeAnn();
TypeAndAnnotation outTa = outJaxbType.getJavaType().getType().getTypeAnn();
if ((((inTa != null) && (outTa != null) && inTa.equals(outTa))) && !inType.equals(outType)) {
String javaType = "javax.activation.DataHandler";
//S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
//JCodeModel cm = jaxbModel.generateCode(null, errReceiver);
JType jt = options.getCodeModel().ref(javaType);
JAXBTypeAndAnnotation jaxbTa = jaxbType.getJavaType().getType();
jaxbTa.setType(jt);
}
}
} else if (ModelerUtils.isUnbound(part)) {
if (part.isIN()) {
req.addUnboundBlock(block);
} else if (part.isOUT()) {
res.addUnboundBlock(block);
} else if (part.isINOUT()) {
req.addUnboundBlock(block);
res.addUnboundBlock(block);
}
}
Parameter param = ModelerUtils.createParameter(part.getName(), jaxbType, block);
param.setMode(part.getMode());
if (part.isReturn()) {
param.setParameterIndex(-1);
} else {
param.setParameterIndex(pIndex++);
}
if (part.isIN())
setCustomizedParameterName(info.portTypeOperation, inMsg, part, param, false);
else if (outMsg != null)
setCustomizedParameterName(info.portTypeOperation, outMsg, part, param, false);
params.add(param);
}
}
if (unwrappable && (outParams != null)) {
int index = params.size();
for (Parameter param : outParams) {
if (JAXBRIContext.mangleNameToVariableName(param.getName()).equals("return")) {
param.setParameterIndex(-1);
} else {
Parameter inParam = ModelerUtils.getParameter(param.getName(), params);
if ((inParam != null) && inParam.isIN()) {
QName inElementName = inParam.getType().getName();
QName outElementName = param.getType().getName();
String inJavaType = inParam.getTypeName();
String outJavaType = param.getTypeName();
TypeAndAnnotation inTa = inParam.getType().getJavaType().getType().getTypeAnn();
TypeAndAnnotation outTa = param.getType().getJavaType().getType().getTypeAnn();
QName inRawTypeName = ModelerUtils.getRawTypeName(inParam);
QName outRawTypeName = ModelerUtils.getRawTypeName(param);
if (inElementName.getLocalPart().equals(outElementName.getLocalPart()) &&
inJavaType.equals(outJavaType) &&
(inTa == null || outTa == null || inTa.equals(outTa)) &&