TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
if (typesMetaData.getTypeMappingByXMLType(xmlType) != null)
javaTypeName = typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName();
if (javaTypeName == null)
throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);
ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName);
boolean hasReturnMapping = true;
if (opMetaData.isDocumentWrapped())
{
if (seiMethodMapping == null)
throw new IllegalArgumentException("Cannot wrap parameters without SEI method mapping");
WsdlReturnValueMapping returnValueMapping = seiMethodMapping.getWsdlReturnValueMapping();
if (returnValueMapping != null)
{
ServiceEndpointInterfaceMapping seiMapping = seiMethodMapping.getServiceEndpointInterfaceMapping();
JavaWsdlMapping javaWsdlMapping = seiMapping.getJavaWsdlMapping();
JavaXmlTypeMapping javaXmlTypeMapping = javaWsdlMapping.getTypeMappingForQName(xmlType);
if (javaXmlTypeMapping == null)
throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);
Map<String, String> map = createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
if (map.size() > 0)
{
String elementName = returnValueMapping.getWsdlMessagePartName();
String variable = map.get(elementName);
if (variable == null)
throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);
String wrappedType = returnValueMapping.getMethodReturnValue();
QName element = new QName(elementName);
WrappedParameter wrappedParameter = new WrappedParameter(element, wrappedType, variable, WrappedParameter.RETURN);
wrappedResponseParameters.add(0, wrappedParameter);
}
}
outMetaData.setWrappedParameters(wrappedResponseParameters);
}
else
{
if (seiMethodMapping != null)
{
MethodParamPartsMapping part = seiMethodMapping.getMethodParamPartsMappingByPartName(opOutput.getPartName());
String mode = null;
if (part != null)
{
WsdlMessageMapping wsdlMessageMapping = part.getWsdlMessageMapping();
mode = wsdlMessageMapping.getParameterMode();
}
if ("INOUT".equals(mode))
{
ParameterMetaData inMetaData = opMetaData.getParameter(xmlName);
if (inMetaData != null)
{
inMetaData.setMode(ParameterMode.INOUT);
return wsdlPosition;
}
throw new WSException("Could not update IN parameter to be INOUT, as indicated in the mapping: " + opOutput.getPartName());
}
// It's potentialy possible that an input parameter could exist with the same part name
else if ("OUT".equals(mode))
{
hasReturnMapping = false;