return params;
}
private List<Parameter> getRpcLitParameters(Request req, Response res, Block reqBlock, Block resBlock, List<MessagePart> paramList) {
List<Parameter> params = new ArrayList<Parameter>();
Message inMsg = getInputMessage();
Message outMsg = getOutputMessage();
S2JJAXBModel jaxbModel = ((RpcLitStructure) reqBlock.getType()).getJaxbModel().getS2JJAXBModel();
List<Parameter> inParams = ModelerUtils.createRpcLitParameters(inMsg, reqBlock, jaxbModel, errReceiver);
List<Parameter> outParams = null;
if (outMsg != null)
outParams = ModelerUtils.createRpcLitParameters(outMsg, resBlock, jaxbModel, errReceiver);
//create parameters for header and mime parts
int index = 0;
for (MessagePart part : paramList) {
Parameter param = null;
if (ModelerUtils.isBoundToSOAPBody(part)) {
if (part.isIN()) {
param = ModelerUtils.getParameter(part.getName(), inParams);
} else if (outParams != null) {
param = ModelerUtils.getParameter(part.getName(), outParams);
}
} else if (ModelerUtils.isBoundToSOAPHeader(part)) {
QName headerName = part.getDescriptor();
JAXBType jaxbType = getJAXBType(part);
Block headerBlock = new Block(headerName, jaxbType, part);
param = ModelerUtils.createParameter(part.getName(), jaxbType, headerBlock);
if (part.isIN()) {
req.addHeaderBlock(headerBlock);
} else if (part.isOUT()) {
res.addHeaderBlock(headerBlock);
} else if (part.isINOUT()) {
req.addHeaderBlock(headerBlock);
res.addHeaderBlock(headerBlock);
}
} else if (ModelerUtils.isBoundToMimeContent(part)) {
List<MIMEContent> mimeContents = null;
if (part.isIN() || part.isINOUT())
mimeContents = getMimeContents(info.bindingOperation.getInput(),
getInputMessage(), part.getName());
else
mimeContents = getMimeContents(info.bindingOperation.getOutput(),
getOutputMessage(), part.getName());
JAXBType type = getAttachmentType(mimeContents, part);
//create Parameters in request or response
//Block mimeBlock = new Block(new QName(part.getName()), type);
Block mimeBlock = new Block(type.getName(), type, part);
param = ModelerUtils.createParameter(part.getName(), type, mimeBlock);
if (part.isIN()) {
req.addAttachmentBlock(mimeBlock);
} else if (part.isOUT()) {
res.addAttachmentBlock(mimeBlock);
} else if (part.isINOUT()) {
mimeContents = getMimeContents(info.bindingOperation.getOutput(),
getOutputMessage(), part.getName());
JAXBType outJaxbType = getAttachmentType(mimeContents, part);
String inType = type.getJavaType().getType().getName();
String outType = outJaxbType.getJavaType().getType().getName();
if (!inType.equals(outType)) {
String javaType = "javax.activation.DataHandler";
JType jt = null;
jt = options.getCodeModel().ref(javaType);
JAXBTypeAndAnnotation jaxbTa = type.getJavaType().getType();
jaxbTa.setType(jt);
}
req.addAttachmentBlock(mimeBlock);
res.addAttachmentBlock(mimeBlock);
}
} else if (ModelerUtils.isUnbound(part)) {
QName name = part.getDescriptor();
JAXBType type = getJAXBType(part);
Block unboundBlock = new Block(name, type, part);
if (part.isIN()) {
req.addUnboundBlock(unboundBlock);
} else if (part.isOUT()) {
res.addUnboundBlock(unboundBlock);
} else if (part.isINOUT()) {
req.addUnboundBlock(unboundBlock);
res.addUnboundBlock(unboundBlock);
}
param = ModelerUtils.createParameter(part.getName(), type, unboundBlock);
}
if (param != null) {
if (part.isReturn()) {
param.setParameterIndex(-1);
} else {
param.setParameterIndex(index++);
}
param.setMode(part.getMode());
params.add(param);
}
}
for (Parameter param : params) {
if (param.isIN())
setCustomizedParameterName(info.portTypeOperation, inMsg, inMsg.getPart(param.getName()), param, false);
else if (outMsg != null)
setCustomizedParameterName(info.portTypeOperation, outMsg, outMsg.getPart(param.getName()), param, false);
}
return params;
}