private void buildMessage(AbstractMessageContainer minfo, Message msg) {
SchemaCollection schemas = minfo.getOperation().getInterface().getService()
.getXmlSchemaCollection();
List<?> orderedParam = msg.getOrderedParts(null);
for (Part part : cast(orderedParam, Part.class)) {
MessagePartInfo pi = minfo.addMessagePart(new QName(minfo.getName().getNamespaceURI(), part
.getName()));
if (part.getTypeName() != null) {
pi.setTypeQName(part.getTypeName());
pi.setElement(false);
pi.setXmlSchema(schemas.getTypeByQName(part.getTypeName()));
} else if (part.getElementName() != null) {
pi.setElementQName(part.getElementName());
XmlSchemaElement schemaElement = schemas.getElementByQName(part.getElementName());
if (null == schemaElement) {
org.apache.cxf.common.i18n.Message errorMessage =
new org.apache.cxf.common.i18n.Message("WSDL4J_BAD_ELEMENT_PART",
LOG,
part.getName(),
part.getElementName());
throw new WSDLRuntimeException(errorMessage);
}
pi.setElement(true);
pi.setXmlSchema(schemaElement);
} else {
org.apache.cxf.common.i18n.Message errorMessage =
new org.apache.cxf.common.i18n.Message("PART_NO_NAME_NO_TYPE",
LOG,
part.getName());