private int processDocElement(OperationMetaData operation, WSDLInterfaceOperation wsdlOperation, WSDLBindingOperation bindingOperation,
ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping, List<WrappedParameter> wrappedParameters,
List<WrappedParameter> wrappedResponseParameters)
{
WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
WSDLBindingOperationInput bindingInput = bindingOperation.getInputs()[0];
int wsdlPosition;
QName xmlName = input.getElement();
QName xmlType = input.getXMLType();
String javaTypeName = typeMapping.getJavaTypeName(xmlType);
TypesMetaData typesMetaData = operation.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
TypeMappingMetaData typeMetaData = typesMetaData.getTypeMappingByXMLType(xmlType);
if (typeMetaData != null)
javaTypeName = typeMetaData.getJavaTypeName();
if (javaTypeName == null)
throw new WSException("Cannot obtain java type mapping for: " + xmlType);
// Check if we need to wrap the parameters
boolean isWrapped = isWrapped(seiMethodMapping, javaTypeName);
operation.getEndpointMetaData().setParameterStyle(isWrapped ? ParameterStyle.WRAPPED : ParameterStyle.BARE);
ParameterMetaData inMetaData = new ParameterMetaData(operation, xmlName, xmlType, javaTypeName);
operation.addParameter(inMetaData);
// Set the variable names
if (inMetaData.getOperationMetaData().isDocumentWrapped())
{
if (seiMethodMapping == null)
throw new IllegalArgumentException("Cannot wrap parameters without SEI method mapping");
ServiceEndpointInterfaceMapping seiMapping = seiMethodMapping.getServiceEndpointInterfaceMapping();
JavaXmlTypeMapping javaXmlTypeMapping = seiMapping.getJavaWsdlMapping().getTypeMappingForQName(xmlType);
if (javaXmlTypeMapping == null)
throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);
Map<String, String> variableMap = createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
for (MethodParamPartsMapping partMapping : seiMethodMapping.getMethodParamPartsMappings())
{
WsdlMessageMapping wsdlMessageMapping = partMapping.getWsdlMessageMapping();
if (wsdlMessageMapping.isSoapHeader())
continue;
if (wsdlMessageMapping == null)
throw new IllegalArgumentException("wsdl-message-message mapping required for document/literal wrapped");
String elementName = wsdlMessageMapping.getWsdlMessagePartName();
// Skip attachments
if (bindingInput.getMimePart(elementName) != null)
continue;
String variable = variableMap.get(elementName);
if (variable == null)
throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);