{
String executionCode = TextContent.EMPTY;
WSDLDocument document = this.getWSDLDocument();
boolean isArrayOutput = false;
WSDLDataType inputWsdlDataType = WSDLDataType.CUSTOM;
if (document.hasOutput(this.getOperationNode()))
{
Node outputNode = document.getOutputNode(this.getOperationNode());
String outputMessageName = document.getOutputMessageCleaned(this.getOperationNode());
Node outputMessageNode = document.getMessageNode(outputMessageName);
String messagePartName = document.getMessagePartName(outputMessageNode);
String messagePartElement = document.getMessagePartElement(outputMessageNode);
String messagePartElementNamespaceAlias = messagePartElement.substring(0, messagePartElement.indexOf(":"));
String messagePartOperationName = messagePartElement.substring(messagePartElement.indexOf(":") + 1);
String messagePartElementNamespace = this.getTypeMetadata().getNamespaces().get(messagePartElementNamespaceAlias);
//Node schemaNode = document.getSchemaByNamespace(messagePartElementNamespace);
//Node schemaElementNode = document.getSchemaElementByNamespaceAndElementName(messagePartElementNamespace, messagePartOperationName);
List<Node> typeSequenceElementNodes = document.getTypeSequenceElements(messagePartElementNamespace, messagePartOperationName);
for (Node typeSequenceElementNode : typeSequenceElementNodes)
{
String varName = this.getWSDLDocument().getTypeSequenceElementName(typeSequenceElementNode);
inputWsdlDataType = document.getTypeSequenceElementDataType(typeSequenceElementNode);
isArrayOutput = document.isArray(typeSequenceElementNode);
varName = this.getReturnValueVariableName(varName);
executionCode = "this." + varName + " = ";
// NOTE: assuming only one value can be returned
break;
}
}
if (isArrayOutput)
{
executionCode += "TypeHelper.convert(";
}
else
{
if (inputWsdlDataType == WSDLDataType.XS_BASE64BINARY)
{
executionCode += "TypeHelper.getString(";
}
}
executionCode += "new ";
executionCode += this.getImplType();
executionCode += "()";
executionCode += ".";
executionCode += this.getOperationName();
executionCode += "(";
if (document.hasInput(this.getOperationNode()))
{
//Node inputNode = document.getInputNode(this.getOperationNode());
String inputMessageName = document.getInputMessageCleaned(this.getOperationNode());
Node inputMessageNode = document.getMessageNode(inputMessageName);
//String messagePartName = document.getMessagePartName(inputMessageNode);
String messagePartElement = document.getMessagePartElement(inputMessageNode);
if (messagePartElement.length() > CollectionSize.EMPTY)
{
String messagePartElementNamespaceAlias = messagePartElement.substring(0, messagePartElement.indexOf(":"));
String messagePartOperationName = messagePartElement.substring(messagePartElement.indexOf(":") + 1);
String messagePartElementNamespace = this.getTypeMetadata().getNamespaces().get(messagePartElementNamespaceAlias);
//Node schemaNode = document.getSchemaByNamespace(messagePartElementNamespace);
//Node schemaElementNode = document.getSchemaElementByNamespaceAndElementName(messagePartElementNamespace, messagePartOperationName);
List<Node> typeSequenceElementNodes = document.getTypeSequenceElements(messagePartElementNamespace, messagePartOperationName);
int nodeCount = 0;
for (Node typeSequenceElementNode : typeSequenceElementNodes)
{
nodeCount++;
executionCode += TextContent.NEWLINE + JavaOutputProducer.CODE_INDENT_TEXT_EXTRA;
WSDLDataType wsdlDataType = document.getTypeSequenceElementDataType(typeSequenceElementNode);
String initialTypeName = document.getTypeSequenceElementDataTypeText(typeSequenceElementNode);
String varName = document.getTypeSequenceElementName(typeSequenceElementNode);
boolean isArray = document.isArray(typeSequenceElementNode);
String typeName = this.getResolvedTypeName(initialTypeName, wsdlDataType, isArray, false);