{"record":{"id":"5c955771ed42e304","repo":"pentaho/pentaho-kettle","slug":"service-serviceqname-is-not-defined-in-the-wsdl-file","errorCode":null,"errorMessage":"Service:  + serviceQName +  is not defined in the WSDL file.","messagePattern":"Service:  \\+ serviceQName \\+  is not defined in the WSDL file\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/Wsdl.java","lineNumber":161,"sourceCode":"  }\n\n  public Wsdl( WSDLLocator wsdlLocator, QName serviceQName, String portName, String username, String password ) throws AuthenticationException {\n\n    // load and parse the WSDL\n    try {\n      _wsdlDefinition = parse( wsdlLocator, username, password );\n    } catch ( AuthenticationException ae ) {\n      // throw it again or KettleException will catch it\n      throw ae;\n    } catch ( WSDLException e ) {\n      throw new RuntimeException( \"Could not load WSDL file: \" + e.getMessage(), e );\n    } catch ( KettleException e ) {\n      throw new RuntimeException( \"Could not load WSDL file: \" + e.getMessage(), e );\n    }\n\n    _service = _wsdlDefinition.getService( serviceQName );\n    if ( _service == null ) {\n      throw new IllegalArgumentException( \"Service: \" + serviceQName + \" is not defined in the WSDL file.\" );\n    }\n\n    _port = _service.getPort( portName );\n    if ( _port == null ) {\n      throw new IllegalArgumentException( \"Port: \" + portName + \" is not defined in the service: \" + serviceQName );\n    }\n\n    _wsdlTypes = new WsdlTypes( _wsdlDefinition );\n    _operationCache = new HashMap<String, WsdlOperation>();\n  }\n\n  /**\n   * Get the WsdlComplexTypes instance of this wsdl. WsdlComplex types provides type information for named complextypes\n   * defined in the wsdl's &lt;types&gt; section.\n   *\n   * @return WsdlComplexTypes instance.\n   */\n  public WsdlComplexTypes getComplexTypes() {","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/Wsdl.java#L143-L179","documentation":"Guard in the Wsdl constructor: a service QName was supplied, but the parsed WSDL definition contains no service under that name. The IllegalArgumentException names the requested service and the WSDL URI so the mismatch can be corrected.","triggerScenarios":"new Wsdl(wsdlLocator, serviceQName, portName, ...) where serviceQName's namespace/local-part does not match any service definition in the located WSDL.","commonSituations":"Stale service name after WSDL regeneration; namespace mismatch (targetNamespace changed by the provider); wrong WSDL loaded by a misconfigured locator.","solutions":["Copy the exact service name and targetNamespace from the loaded WSDL into the configuration","Dump available services from the Definition (getServices().keySet()) to see valid QNames","Verify the locator actually fetches the intended WSDL (log the resolved URI)","Update the transform metadata after any provider-side WSDL change"],"exampleFix":"// before\nQName svc = new QName(\"http://old.example.com/\", \"MyService\");\n// after\nQName svc = new QName(\"http://new.example.com/v2/\", \"MyServiceV2\"); // from current WSDL","handlingStrategy":"validation","validationCode":"Definition d = WSDLFactory.newInstance().newWSDLReader().readWSDL(wsdlUrl);\nSet<QName> names = d.getServices().keySet();\nif (!names.contains(serviceQName)) throw new IllegalArgumentException(\"Service not found; available: \" + names);","typeGuard":null,"tryCatchPattern":"try {\n  Wsdl wsdl = new Wsdl(loc, serviceQName, portName, user, pass);\n} catch (IllegalArgumentException e) {\n  logError(\"Service not in WSDL: \" + e.getMessage());\n  throw e;\n}","preventionTips":["Regenerate the service QName from the latest WSDL whenever it changes","Diff old vs new WSDL targetNamespace after provider upgrades","Pin to a frozen copy of the WSDL for stability across releases","Log d.getServices().keySet() to discover valid QNames at runtime"],"tags":["wsdl","qname","configuration","webservices"],"backgroundTag":"entity-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"}