{"record":{"id":"979c3d1512792331","repo":"pentaho/pentaho-kettle","slug":"invalid-element-e-getnodename","errorCode":null,"errorMessage":"invalid element:  + e.getNodeName()","messagePattern":"invalid element:  \\+ e\\.getNodeName\\(\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/WsdlOpParameter.java","lineNumber":115,"sourceCode":"   *          Wsdl types abstraction.\n   */\n  WsdlOpParameter( Element e, WsdlTypes wsdlTypes ) {\n\n    _mode = ParameterMode.UNDEFINED;\n    _isArray = isArray( e );\n    _isHeader = false;\n\n    if ( e.hasAttribute( WsdlUtils.NAME_ATTR ) && e.hasAttribute( WsdlUtils.ELEMENT_TYPE_ATTR ) ) {\n      setName( e.getAttribute( WsdlUtils.NAME_ATTR ), wsdlTypes );\n      _xmlType = wsdlTypes.getTypeQName( e.getAttribute( WsdlUtils.ELEMENT_TYPE_ATTR ) );\n    } else if ( e.hasAttribute( WsdlUtils.ELEMENT_REF_ATTR ) ) {\n      _xmlType = wsdlTypes.getTypeQName( e.getAttribute( WsdlUtils.ELEMENT_REF_ATTR ) );\n      _name = new QName( \"\", _xmlType.getLocalPart() );\n    } else if ( e.hasAttribute( WsdlUtils.NAME_ATTR ) ) {\n      setName( e.getAttribute( WsdlUtils.NAME_ATTR ), wsdlTypes );\n      _xmlType = getElementType( e, wsdlTypes );\n    } else {\n      throw new RuntimeException( \"invalid element: \" + e.getNodeName() );\n    }\n\n    // check to see if the xml type of this element is an array type\n    Element t = wsdlTypes.findNamedType( _xmlType );\n    if ( t != null && WsdlUtils.COMPLEX_TYPE_NAME.equals( t.getLocalName() ) ) {\n      _itemXmlType = getArrayItemType( t, wsdlTypes );\n      _isArray = _itemXmlType != null;\n      if ( _itemXmlType != null ) {\n        _itemComplexType = wsdlTypes.getNamedComplexTypes().getComplexType( _itemXmlType.getLocalPart() );\n      }\n    }\n  }\n\n  /**\n   * Get the name of this parameter.\n   *\n   * @return QName.\n   */","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/WsdlOpParameter.java#L97-L133","documentation":"The WsdlOpParameter constructor maps a WSDL <part> (or element) DOM node to a parameter object. It recognizes nodes that either have an element-reference attribute or a name attribute; a node with neither throws RuntimeException \"invalid element: <nodeName>\". This indicates the WSDL contains an element shape the parameter mapper does not understand.","triggerScenarios":"Constructing WsdlOpParameter from an org.w3c.dom.Element that lacks both WsdlUtils.ELEMENT_REF_ATTR (element=) and WsdlUtils.NAME_ATTR (name=) — e.g., a malformed or nonstandard <part>/<element> in the WSDL.","commonSituations":"Vendor-generated WSDLs with exotic constructs (e.g., parts declared only via type= with unusual attributes the parser doesn't expect); hand-edited WSDL where the name attribute was deleted; schema-level elements that are only referenced anonymously.","solutions":["Open the WSDL at the referenced element and ensure it declares either name=\"...\" (with type) or element=\"...\" on the part/element.","Regenerate the WSDL from the service tooling rather than hand-editing, so required attributes are emitted.","Validate the WSDL with a validator (e.g., wsimport / xmlspy) to catch malformed elements before loading them in Pentaho.","If the element is genuinely unsupported, refactor the WSDL contract to use standard document/literal wrapped style."],"exampleFix":"<!-- before (invalid: part has no name or element ref) -->\n<part xmlns=\"http://schemas.xmlsoap.org/wsdl/\" type=\"xsd:string\"/>\n<!-- after -->\n<part name=\"payload\" type=\"xsd:string\"/>","handlingStrategy":"validation","validationCode":"// Ensure the element node declares name or element-ref before constructing\nif (!e.hasAttribute(\"element\") && !e.hasAttribute(\"name\")) {\n  throw new IllegalArgumentException(\"Element '\" + e.getNodeName()\n    + \"' has neither 'element' nor 'name' attribute — fix the WSDL first\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  WsdlOpParameter p = new WsdlOpParameter(e, wsdlTypes);\n} catch (RuntimeException re) {\n  if (re.getMessage() != null && re.getMessage().startsWith(\"invalid element:\")) {\n    logError(\"Unsupported WSDL element structure at <\" + e.getNodeName() + \">; check name/element attributes\", re);\n  }\n  throw re;\n}","preventionTips":["Regenerate WSDLs from tooling instead of hand-editing","Validate WSDL/XSD with a schema validator before loading","Inspect the offending element's attributes in the raw WSDL"],"tags":["wsdl","xml","schema","parsing"],"backgroundTag":"invalid-argument-format","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"}