{"record":{"id":"4d1ae2c0b1456d64","repo":"pentaho/pentaho-kettle","slug":"wsdl-error-missingschemaexception","errorCode":"Wsdl.Error.MissingSchemaException","errorMessage":"Wsdl.Error.MissingSchemaException","messagePattern":"Wsdl\\.Error\\.MissingSchemaException","errorType":"error_code","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/WsdlTypes.java","lineNumber":78,"sourceCode":"    _elementFormQualifiedNamespaces = new HashSet<String>( getElementFormQualifiedNamespaces() );\n    _namedComplexTypes = new WsdlComplexTypes( this );\n  }\n\n  /**\n   * Find a named &lt;element&gt; in the types section of the WSDL.\n   *\n   * @param elementName\n   *          Name of element to find.\n   * @return The element node.\n   * @throws KettleStepException\n   *           If schema or element in schema can't be found for the given element name\n   */\n  protected Element findNamedElement( QName elementName ) throws KettleStepException {\n\n    Element namedElement = null;\n    Schema s = getSchema( elementName.getNamespaceURI() );\n    if ( s == null ) {\n      throw new KettleStepException( BaseMessages\n        .getString( PKG, \"Wsdl.Error.MissingSchemaException\", elementName ) );\n    }\n\n    Element schemaRoot = s.getElement();\n    List<Element> elements = DomUtils.getChildElementsByName( schemaRoot, WsdlUtils.ELEMENT_NAME );\n\n    for ( Element e : elements ) {\n      String schemaElementName = e.getAttribute( WsdlUtils.NAME_ATTR );\n      if ( elementName.getLocalPart().equals( schemaElementName ) ) {\n        namedElement = e;\n        break;\n      }\n    }\n\n    if ( namedElement == null ) {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"Wsdl.Error.ElementMissingException\", elementName ) );\n    }","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/WsdlTypes.java#L60-L96","documentation":"WsdlTypes.findNamedElement(QName) first resolves the schema for the element's namespace URI. If no <schema> with that targetNamespace was collected while parsing the WSDL, a KettleStepException with message key Wsdl.Error.MissingSchemaException is thrown, because the element cannot be searched for without its schema.","triggerScenarios":"Calling findNamedElement with a QName whose namespace URI has no corresponding <xsd:schema targetNamespace=\"...\"> in the loaded WSDL/schemas — e.g., an element defined in an imported schema that was not fetched or not parsed.","commonSituations":"The WSDL imports XSDs by URL and the import was not retrievable at parse time; the namespace URI is mistyped or differs by trailing slash; the element lives in a separate schema document that the WSDL parser did not load (no network access to imported XSDs).","solutions":["Ensure all <xsd:import>/<xsd:include> schema locations referenced by the WSDL are reachable (network/proxy access) so their namespaces get registered.","Compare the QName's namespace URI character-by-character against the schema's targetNamespace in the WSDL (trailing slash, http vs https).","Download imported XSDs locally and rewrite the WSDL imports to local paths before loading.","Verify the WSDL itself declares a schema for the namespace instead of relying on a remote default."],"exampleFix":"// before\nQName el = new QName(\"http://example.com/types\", \"Address\"); // namespace with no schema in WSDL\nwsdlTypes.findNamedElement(el);\n// after — use the namespace that matches an actual <schema targetNamespace>\nQName el = new QName(\"http://example.com/types/v1\", \"Address\");\nwsdlTypes.findNamedElement(el);","handlingStrategy":"validation","validationCode":"// Confirm a schema for the namespace exists before lookup\nif (wsdlTypes.getSchema(elementName.getNamespaceURI()) == null) {\n  throw new IllegalArgumentException(\"No schema loaded for namespace: \" + elementName.getNamespaceURI());\n}\nwsdlTypes.findNamedElement(elementName);","typeGuard":null,"tryCatchPattern":"try {\n  Element el = wsdlTypes.findNamedElement(qname);\n} catch (KettleStepException kse) {\n  if (kse.getMessage() != null && kse.getMessage().contains(\"MissingSchema\")) {\n    logError(\"Schema not loaded for namespace \" + qname.getNamespaceURI() + \" — check xsd:import reachability\", kse);\n  }\n  throw kse;\n}","preventionTips":["Make all xsd:import locations reachable at parse time","Match namespace URIs exactly (trailing slash, http vs https)","Bundle imported XSDs locally when behind firewalls"],"tags":["wsdl","xsd","namespace","schema"],"backgroundTag":"schema-not-found","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"}