{"record":{"id":"bd8ca4c66574a88e","repo":"pentaho/pentaho-kettle","slug":"unable-to-get-value-for-field-field-getname-verify-that-this","errorCode":null,"errorMessage":"Unable to get value for field [ + field.getName() + ].  Verify that this is not a complex data type by looking at the response XML.","messagePattern":"Unable to get value for field \\[ \\+ field\\.getName\\(\\) \\+ \\]\\.  Verify that this is not a complex data type by looking at the response XML\\.","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/webservices/WebService.java","lineNumber":876,"sourceCode":"                } else {\n                  WebServiceField field =\n                    meta.getFieldOutFromWsName( vReader.getLocalName(), ignoreNamespacePrefix );\n                  if ( meta.getFieldsOut().size() == 1 && field != null ) {\n                    // This can be either a simple return element, or a complex type...\n                    //\n                    try {\n                      if ( meta.isPassingInputData() ) {\n                        for ( int i = 0; i < rowMeta.getValueMetaList().size(); i++ ) {\n                          ValueMetaInterface valueMeta = getInputRowMeta().getValueMeta( i );\n                          outputRowData[ outputIndex++ ] = valueMeta.cloneValueData( rowData[ i ] );\n\n                        }\n                      }\n\n                      outputRowData[ outputIndex++ ] = getValue( vReader.getElementText(), field );\n                      putRow( data.outputRowMeta, outputRowData );\n                    } catch ( XMLStreamException e ) {\n                      throw new KettleStepException( \"Unable to get value for field [\"\n                        + field.getName()\n                        + \"].  Verify that this is not a complex data type by looking at the response XML.\", e );\n                    }\n                  } else {\n                    for ( WebServiceField curField : meta.getFieldsOut() ) {\n                      if ( !Utils.isEmpty( curField.getName() ) ) {\n                        outputRowData[ outputIndex++ ] = getValue( vReader.getElementText(), curField );\n                      }\n                    }\n                    processing = true;\n                  }\n                }\n\n              } else {\n                if ( log.isRowLevel() ) {\n                  logRowlevel( \"vReader.getLocalName = \" + vReader.getLocalName() );\n                }\n                if ( log.isRowLevel() ) {","sourceCodeStart":858,"sourceCodeEnd":894,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/webservices/WebService.java#L858-L894","documentation":"KettleStepException thrown while reading a mapped output field's value via vReader.getElementText() in WebService's StAX row-processing path. An XMLStreamException here usually means the element mapped to the field is a complex (nested) type or ends earlier than expected, so the reader cannot produce simple text content.","triggerScenarios":"During processRows with single-field/specific-field output mapping: vReader.getElementText() throws XMLStreamException because the current element has child elements (complex data type) instead of plain text.","commonSituations":"Developer maps a nested/complex element (e.g. an object with child elements) to a scalar output field; SOAP response structure changed so the mapped element now wraps children; namespace prefixes cause the reader to land on the wrong element.","solutions":["Inspect the response XML: if the mapped field is a complex type, map its leaf text elements individually instead.","Enable 'pass complex data as XML' style handling or map the parent node so it is serialized as XML rather than read as text.","Verify field names and namespace handling ('ignore namespace prefix') match the response.","Re-fetch the operation/WSDL metadata if the service contract changed."],"exampleFix":"// before\n// output field \"address\" mapped to the complex <address><street>..</street></address> element\n// after\n// map output field \"street\" to the leaf element <street> which contains text","handlingStrategy":"validation","validationCode":"// Before mapping, confirm each configured output field is a leaf (text-only) element in the response:\n// e.g. check with XPath that the element has no element children:\nNodeList kids = (NodeList) xpath.evaluate(field.getName() + \"/*\", doc, XPathConstants.NODESET);\nif (kids.getLength() > 0) throw new IllegalStateException(\"Complex type mapped as scalar: \" + field.getName());","typeGuard":null,"tryCatchPattern":"try {\n  // run transformation\n} catch (KettleStepException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Verify that this is not a complex data type\")) {\n    // remap the offending field to its leaf child elements\n  }\n}","preventionTips":["Map only leaf elements with text content as output fields.","Re-check mappings whenever the service schema changes.","Use 'ignore namespace prefix' when the service emits prefixes."],"tags":["kettle","webservice","xml","data-type"],"backgroundTag":"unexpected-response-shape","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}