{"record":{"id":"2f3308ac3820a316","repo":"pentaho/pentaho-kettle","slug":"service-serviceqname-is-not-defined-in-the-wsdl-file-wsdluri","errorCode":null,"errorMessage":"Service:  + serviceQName +  is not defined in the WSDL file  + wsdlURI","messagePattern":"Service:  \\+ serviceQName \\+  is not defined in the WSDL file  \\+ wsdlURI","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/Wsdl.java","lineNumber":91,"sourceCode":"  public Wsdl( URI wsdlURI, QName serviceQName, String portName, String username, String password ) throws AuthenticationException {\n\n    this.wsdlURI = wsdlURI;\n    try {\n      _wsdlDefinition = parse( wsdlURI, username, password );\n    } catch ( AuthenticationException ae ) {\n      // throw this again since KettleException is catching 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    if ( serviceQName == null ) {\n      _service = (Service) _wsdlDefinition.getServices().values().iterator().next();\n    } else {\n      _service = _wsdlDefinition.getService( serviceQName );\n      if ( _service == null ) {\n        throw new IllegalArgumentException( \"Service: \"\n          + serviceQName + \" is not defined in the WSDL file \" + wsdlURI );\n      }\n    }\n\n    if ( portName == null ) {\n      _port = getSoapPort( _service.getPorts().values() );\n    } else {\n      _port = _service.getPort( portName );\n      if ( _port == null ) {\n        throw new IllegalArgumentException( \"Port: \"\n          + portName + \" is not defined in the service: \" + serviceQName );\n      } else {\n        _port = _service.getPort( portName );\n      }\n    }\n\n    _wsdlTypes = new WsdlTypes( _wsdlDefinition );\n    _operationCache = new HashMap<String, WsdlOperation>();","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/Wsdl.java#L73-L109","documentation":"IllegalArgumentException from the URI-based Wsdl constructor when the WSDL document loaded fine but does not contain a <service> whose QName equals the requested serviceQName. The parser requires an explicit service match; it never silently falls back.","triggerScenarios":"new Wsdl(wsdlURI, username, password, serviceQName, ...) with a serviceQName whose local part or namespace does not match any <wsdl:service name=... targetNamespace=...> in the document.","commonSituations":"Service renamed on the server after the transform was configured; namespace URI typo (target namespace must match exactly, including trailing slash); copying a transform between services without updating the service QName.","solutions":["Open the WSDL and copy the exact <service name> and its targetNamespace into the transform settings","Ensure the namespace portion of the QName matches the WSDL targetNamespace character-for-character","Re-import/refresh the transform's WSDL metadata after a server-side WSDL change","Leave serviceQName null (or blank) if you want the first service in the document to be auto-selected"],"exampleFix":"// before\nQName svc = new QName(\"http://example.com/wrong-ns\", \"MyService\");\n// after\nQName svc = new QName(\"http://example.com/actual/targetNamespace\", \"MyService\"); // copied from WSDL","handlingStrategy":"validation","validationCode":"javax.wsdl.Definition d = WSDLFactory.newInstance().newWSDLReader().readWSDL(wsdlUrl);\nboolean found = d.getServices().keySet().contains(serviceQName);\nif (!found) throw new IllegalArgumentException(\"Unknown service \" + serviceQName + \"; available: \" + d.getServices().keySet());","typeGuard":null,"tryCatchPattern":"try {\n  Wsdl wsdl = new Wsdl(uri, user, pass, serviceQName, portName);\n} catch (IllegalArgumentException e) {\n  logError(\"Service mismatch: \" + e.getMessage() + \" — re-import the WSDL metadata\");\n  throw e;\n}","preventionTips":["Copy the service QName directly from the <wsdl:service> element of the current WSDL","Match the targetNamespace exactly, including trailing slashes","Re-import the WSDL in the transform UI after server-side WSDL updates","Prefer null serviceQName (auto-pick first service) when the WSDL has only one service"],"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"}