pentaho/pentaho-kettle · error · IllegalArgumentException

Service: + serviceQName + is not defined in the WSDL file.

Error message

Service:  + serviceQName +  is not defined in the WSDL file.

What it means

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.

Solutions

  1. Copy the exact service name and targetNamespace from the loaded WSDL into the configuration
  2. Dump available services from the Definition (getServices().keySet()) to see valid QNames
  3. Verify the locator actually fetches the intended WSDL (log the resolved URI)
  4. Update the transform metadata after any provider-side WSDL change

Example fix

// before
QName svc = new QName("http://old.example.com/", "MyService");
// after
QName svc = new QName("http://new.example.com/v2/", "MyServiceV2"); // from current WSDL
Defensive patterns

Strategy: validation

Validate before calling

Definition d = WSDLFactory.newInstance().newWSDLReader().readWSDL(wsdlUrl);
Set<QName> names = d.getServices().keySet();
if (!names.contains(serviceQName)) throw new IllegalArgumentException("Service not found; available: " + names);

Try / catch

try {
  Wsdl wsdl = new Wsdl(loc, serviceQName, portName, user, pass);
} catch (IllegalArgumentException e) {
  logError("Service not in WSDL: " + e.getMessage());
  throw e;
}

Prevention

When it happens

Trigger: new Wsdl(wsdlLocator, serviceQName, portName, ...) where serviceQName's namespace/local-part does not match any service definition in the located WSDL.

Common situations: Stale service name after WSDL regeneration; namespace mismatch (targetNamespace changed by the provider); wrong WSDL loaded by a misconfigured locator.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/5c955771ed42e304. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/Wsdl.java:161

  }

  public Wsdl( WSDLLocator wsdlLocator, QName serviceQName, String portName, String username, String password ) throws AuthenticationException {

    // load and parse the WSDL
    try {
      _wsdlDefinition = parse( wsdlLocator, username, password );
    } catch ( AuthenticationException ae ) {
      // throw it again or KettleException will catch it
      throw ae;
    } catch ( WSDLException e ) {
      throw new RuntimeException( "Could not load WSDL file: " + e.getMessage(), e );
    } catch ( KettleException e ) {
      throw new RuntimeException( "Could not load WSDL file: " + e.getMessage(), e );
    }

    _service = _wsdlDefinition.getService( serviceQName );
    if ( _service == null ) {
      throw new IllegalArgumentException( "Service: " + serviceQName + " is not defined in the WSDL file." );
    }

    _port = _service.getPort( portName );
    if ( _port == null ) {
      throw new IllegalArgumentException( "Port: " + portName + " is not defined in the service: " + serviceQName );
    }

    _wsdlTypes = new WsdlTypes( _wsdlDefinition );
    _operationCache = new HashMap<String, WsdlOperation>();
  }

  /**
   * Get the WsdlComplexTypes instance of this wsdl. WsdlComplex types provides type information for named complextypes
   * defined in the wsdl's &lt;types&gt; section.
   *
   * @return WsdlComplexTypes instance.
   */
  public WsdlComplexTypes getComplexTypes() {

View on GitHub (pinned to f3058517a1)