pentaho/pentaho-kettle · error · IllegalArgumentException

Port name: ' + portName + ' was not found in the WSDL file.

Error message

Port name: ' + portName + ' was not found in the WSDL file.

What it means

Wsdl.setPort(QName) looks up the requested port (endpoint) in the parsed WSDL service definition. If wsdl4j's Service.getPort() returns null — i.e., no port with that local part exists under the configured service — an IllegalArgumentException is thrown and the WSDL object is left without a port. This guards against proceeding with a null port, which would later fail in operation lookup.

Solutions

  1. Open the WSDL, find the target <wsdl:service>, and copy the exact <wsdl:port name="..."> value into the step's port configuration.
  2. Verify the service name configured on the Wsdl object matches the <wsdl:service name="..."> that actually contains the port.
  3. Re-download the current WSDL from the service URL — an outdated cached WSDL may reference removed ports.
  4. Check case sensitivity and whitespace: port lookups are exact string matches on the local part.

Example fix

// before
wsdl.setService(new QName(ns, "OldService"));
wsdl.setPort(new QName(ns, "PriceListPort"));
// after
wsdl.setService(new QName(ns, "PriceListService")); // service that actually declares the port
wsdl.setPort(new QName(ns, "PriceListSoapPort"));   // exact <wsdl:port name=""> from the WSDL
Defensive patterns

Strategy: validation

Validate before calling

// Pre-validate the port against the parsed service before setPort
javax.wsdl.Service svc = wsdl.getService();
if (svc == null || svc.getPort(portName.getLocalPart()) == null) {
  throw new IllegalArgumentException("Port '" + portName.getLocalPart()
    + "' not found in service '" + svc.getQName() + "'; available: " + svc.getPorts().keySet());
}
wsdl.setPort(portName);

Prevention

When it happens

Trigger: Calling wsdl.setPort(new QName(namespace, "SomePort")) where the local part does not match any <wsdl:port> name inside the <wsdl:service> element of the WSDL. Also happens when the service name (set via setService) points at a service that lacks that port, or when the WSDL was fetched from a different URL than expected.

Common situations: Typo or case mismatch in the port name in the Web Service Lookup step configuration; choosing a port that belongs to a different <service> element in the WSDL; the WSDL changed server-side and the port was renamed or removed; pointing the step at a stale WSDL copy.

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/ce9b4356948218cd. Report an issue: GitHub.

Appendix: source

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

   * @return The targetNamespace
   */
  public String getTargetNamespace() {
    return _wsdlDefinition.getTargetNamespace();
  }

  /**
   * Change the port of the service.
   *
   * @param portName
   *          The new port name.
   * @throws IllegalArgumentException
   *           if port name is not defined in WSDL.
   */
  public void setPort( QName portName ) {

    Port port = _service.getPort( portName.getLocalPart() );
    if ( port == null ) {
      throw new IllegalArgumentException( "Port name: '" + portName + "' was not found in the WSDL file." );
    }

    _port = port;
    _operationCache.clear();
  }

  /**
   * Get a WSDLReader.
   *
   * @return WSDLReader.
   * @throws WSDLException
   *           on error.
   */
  private WSDLReader getReader() throws WSDLException {

    WSDLFactory wsdlFactory = WSDLFactory.newInstance();
    WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
    ExtensionRegistry registry = wsdlFactory.newPopulatedExtensionRegistry();

View on GitHub (pinned to f3058517a1)