}
Method method = (Method)opInfo.getProperty(METHOD);
int paraNumber = 0;
for (MessagePartInfo mpi : message.getMessageParts()) {
SchemaInfo schemaInfo = null;
XmlSchema schema = null;
QName qname = (QName)mpi.getProperty(ELEMENT_NAME);
if (message.getMessageParts().size() == 1) {
qname = qname == null && !isOut ? getInParameterName(opInfo, method, -1) : qname;
qname = qname == null && isOut ? getOutParameterName(opInfo, method, -1) : qname;
if (qname.getLocalPart().startsWith("arg") || qname.getLocalPart().startsWith("return")) {
qname = isOut
? new QName(qname.getNamespaceURI(), method.getName() + "Response") : new QName(qname
.getNamespaceURI(), method.getName());
}
}
if (isOut && message.getMessageParts().size() > 1 && qname == null) {
while (!isOutParam(method, paraNumber)) {
paraNumber++;
}
qname = getOutParameterName(opInfo, method, paraNumber);
} else if (qname == null) {
qname = getInParameterName(opInfo, method, paraNumber);
}
for (SchemaInfo s : serviceInfo.getSchemas()) {
if (s.getNamespaceURI().equals(qname.getNamespaceURI())) {
schemaInfo = s;
break;
}
}
if (schemaInfo == null) {
schemaInfo = getOrCreateSchema(serviceInfo, qname.getNamespaceURI(), true);
schema = schemaInfo.getSchema();
} else {
schema = schemaInfo.getSchema();
if (schema != null && schema.getElementByName(qname) != null) {
mpi.setElement(true);
mpi.setElementQName(qname);
mpi.setXmlSchema(schema.getElementByName(qname));
paraNumber++;
continue;
}
}
schemaInfo.setElement(null); //cached element is now invalid
XmlSchemaElement el = new XmlSchemaElement();
XmlSchemaUtils.setElementQName(el, qname);
el.setNillable(true);
if (!isExistSchemaElement(schema, qname)) {