boolean outHeader = isSoapHeader && isOutParam;
QName paramQName;
QName paramTypeQName;
Part part = null;
SchemaParticle inParameter = null;
if (isInParam) {
if (!wsdlMessageQName.equals(input.getQName())) {
throw new DeploymentException("QName of input message: " + input.getQName() +
" does not match mapping message QName: " + wsdlMessageQName + " for operation " + operationName);
}
if (wrappedStyle) {
Part inPart = getWrappedPart(input);
// the local name of the global element refered by the part is equal to the operation name
QName name = inPart.getElementName();
if (false == name.getLocalPart().equals(operationName)) {
throw new DeploymentException("message " + input.getQName() + " refers to a global element named " +
name.getLocalPart() + ", which is not equal to the operation name " + operationName);
}
inParameter = getWrapperChild(inPart, wsdlMessagePartName);
//TODO this makes little sense but may be correct, see comments in axis Parameter class
//the part name qname is really odd.
paramQName = new QName("", inParameter.getName().getLocalPart());
paramTypeQName = inParameter.getType().getName();
} else if (rpcStyle) {
part = input.getPart(wsdlMessagePartName);
if (part == null) {
throw new DeploymentException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in input message for operation " + operationName);
}
//TODO this makes little sense but may be correct, see comments in axis Parameter class
//the part name qname is really odd.
paramQName = new QName("", part.getName());
paramTypeQName = part.getTypeName();
} else {
part = input.getPart(wsdlMessagePartName);
if (part == null) {
throw new DeploymentException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in input message for operation " + operationName);
}
paramQName = getPartName(part);
paramTypeQName = paramQName;
}
inParamNames.add(wsdlMessagePartName);
if (isOutParam) {
if (wrappedStyle) {
Part outPart = getWrappedPart(output);
SchemaParticle outParameter = getWrapperChild(outPart, wsdlMessagePartName);
if (inParameter.getType() != outParameter.getType()) {
throw new DeploymentException("The wrapper children " + wsdlMessagePartName +
" do not have the same type for operation " + operationName);
}
} else if (rpcStyle) {
//inout, check that part of same name and type is in output message
Part outPart = output.getPart(wsdlMessagePartName);
if (outPart == null) {
throw new DeploymentException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for INOUT parameter of operation " + operationName);
}
// TODO this cannot happen.
if (!part.getName().equals(outPart.getName())) {
throw new DeploymentException("Mismatched input part name: " + part.getName() + " and output part name: " + outPart.getName() + " for INOUT parameter for wsdlMessagePartName " + wsdlMessagePartName + " for operation " + operationName);
}
if (!(part.getElementName() == null ? outPart.getElementName() == null : part.getElementName().equals(outPart.getElementName()))) {
throw new DeploymentException("Mismatched input part element name: " + part.getElementName() + " and output part element name: " + outPart.getElementName() + " for INOUT parameter for wsdlMessagePartName " + wsdlMessagePartName + " for operation " + operationName);
}
if (!(part.getTypeName() == null ? outPart.getTypeName() == null : part.getTypeName().equals(outPart.getTypeName()))) {
throw new DeploymentException("Mismatched input part type name: " + part.getTypeName() + " and output part type name: " + outPart.getTypeName() + " for INOUT parameter for wsdlMessagePartName " + wsdlMessagePartName + " for operation " + operationName);
}
} else {
part = output.getPart(wsdlMessagePartName);
if (part == null) {
throw new DeploymentException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
}
paramQName = getPartName(part);
paramTypeQName = paramQName;
}
outParamNames.add(wsdlMessagePartName);
}
} else if (isOutParam) {
if (!wsdlMessageQName.equals(output.getQName())) {
throw new DeploymentException("QName of output message: " + output.getQName() +
" does not match mapping message QName: " + wsdlMessageQName + " for operation " + operationName);
}
if (wrappedStyle) {
Part outPart = getWrappedPart(output);
SchemaParticle outParameter = getWrapperChild(outPart, wsdlMessagePartName);
//TODO this makes little sense but may be correct, see comments in axis Parameter class
//the part name qname is really odd.
paramQName = new QName("", outParameter.getName().getLocalPart());
paramTypeQName = outParameter.getType().getName();