}
if (wrappedStyle) {
Part inputPart = getWrappedPart(input);
QName name = inputPart.getElementName();
SchemaType operationType = (SchemaType) schemaInfoBuilder.getComplexTypesInWsdl().get(name);
Set expectedInParams = new HashSet();
// schemaType should be complex using xsd:sequence compositor
SchemaParticle parametersType = operationType.getContentModel();
//parametersType can be null if the element has empty content such as
// <element name="getMarketSummary">
// <complexType>
// <sequence/>
// </complexType>
// </element>
if (parametersType != null) {
if (SchemaParticle.ELEMENT == parametersType.getParticleType()) {
expectedInParams.add(parametersType.getName().getLocalPart());
} else if (SchemaParticle.SEQUENCE == parametersType.getParticleType()) {
SchemaParticle[] parameters = parametersType.getParticleChildren();
for (int i = 0; i < parameters.length; i++) {
expectedInParams.add(parameters[i].getName().getLocalPart());
}
}
}
if (!inParamNames.equals(expectedInParams)) {
throw new DeploymentException("Not all wrapper children were mapped for operation name" + operationName);
}
} else {
//check that all input message parts are mapped
if (!inParamNames.equals(input.getParts().keySet())) {
throw new DeploymentException("Not all input message parts were mapped for operation name" + operationName);
}
}
Class[] paramTypes = new Class[parameterDescriptions.length];
for (int i = 0; i < parameterDescriptions.length; i++) {
ParameterDesc parameterDescription = parameterDescriptions[i];
if (parameterDescription == null) {
throw new DeploymentException("There is no mapping for parameter number " + i + " for operation " + operationName);
}
operationDesc.addParameter(parameterDescription);
paramTypes[i] = parameterDescription.getJavaType();
}
String methodName = methodMapping.getJavaMethodName().getStringValue().trim();
Method method = null;
try {
method = serviceEndpointInterface.getMethod(methodName, paramTypes);
} catch (NoSuchMethodException e) {
String args = "(";
for (int i = 0; i < paramTypes.length; i++) {
args += paramTypes[i].getName();
if (i < paramTypes.length - 1) {
args += ",";
}
}
args += ")";
throw new DeploymentException("Mapping references non-existent method in service-endpoint: " + methodName + args);
}
operationDesc.setMethod(method);
// MAP RETURN TYPE
operationDesc.setMep(operation.getStyle());
if (methodMapping.isSetWsdlReturnValueMapping()) {
mapReturnType();
} else if (operation.getStyle() == OperationType.REQUEST_RESPONSE) {
//TODO WARNING THIS APPEARS TO SUBVERT THE COMMENT IN j2ee_jaxrpc_mapping_1_1.xsd IN service-endpoint-method-mappingType:
//The wsdl-return-value-mapping is not specified for one-way operations.
operationDesc.setReturnQName(null); //??
operationDesc.setReturnType(XMLType.AXIS_VOID);
operationDesc.setReturnClass(void.class);
}
if (null != output && wrappedStyle) {
Part inputPart = getWrappedPart(output);
QName name = inputPart.getElementName();
SchemaType operationType = (SchemaType) schemaInfoBuilder.getComplexTypesInWsdl().get(name);
Set expectedOutParams = new HashSet();
// schemaType should be complex using xsd:sequence compositor
SchemaParticle parametersType = operationType.getContentModel();
//again, no output can give null parametersType
if (parametersType != null) {
if (SchemaParticle.ELEMENT == parametersType.getParticleType()) {
expectedOutParams.add(parametersType.getName().getLocalPart());
} else if (SchemaParticle.SEQUENCE == parametersType.getParticleType()) {