{"record":{"id":"ce9b4356948218cd","repo":"pentaho/pentaho-kettle","slug":"port-name-portname-was-not-found-in-the-wsdl-file","errorCode":null,"errorMessage":"Port name: ' + portName + ' was not found in the WSDL file.","messagePattern":"Port name: ' \\+ portName \\+ ' was not found 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":295,"sourceCode":"   * @return The targetNamespace\n   */\n  public String getTargetNamespace() {\n    return _wsdlDefinition.getTargetNamespace();\n  }\n\n  /**\n   * Change the port of the service.\n   *\n   * @param portName\n   *          The new port name.\n   * @throws IllegalArgumentException\n   *           if port name is not defined in WSDL.\n   */\n  public void setPort( QName portName ) {\n\n    Port port = _service.getPort( portName.getLocalPart() );\n    if ( port == null ) {\n      throw new IllegalArgumentException( \"Port name: '\" + portName + \"' was not found in the WSDL file.\" );\n    }\n\n    _port = port;\n    _operationCache.clear();\n  }\n\n  /**\n   * Get a WSDLReader.\n   *\n   * @return WSDLReader.\n   * @throws WSDLException\n   *           on error.\n   */\n  private WSDLReader getReader() throws WSDLException {\n\n    WSDLFactory wsdlFactory = WSDLFactory.newInstance();\n    WSDLReader wsdlReader = wsdlFactory.newWSDLReader();\n    ExtensionRegistry registry = wsdlFactory.newPopulatedExtensionRegistry();","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/webservices/wsdl/Wsdl.java#L277-L313","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Open the WSDL, find the target <wsdl:service>, and copy the exact <wsdl:port name=\"...\"> value into the step's port configuration.","Verify the service name configured on the Wsdl object matches the <wsdl:service name=\"...\"> that actually contains the port.","Re-download the current WSDL from the service URL — an outdated cached WSDL may reference removed ports.","Check case sensitivity and whitespace: port lookups are exact string matches on the local part."],"exampleFix":"// before\nwsdl.setService(new QName(ns, \"OldService\"));\nwsdl.setPort(new QName(ns, \"PriceListPort\"));\n// after\nwsdl.setService(new QName(ns, \"PriceListService\")); // service that actually declares the port\nwsdl.setPort(new QName(ns, \"PriceListSoapPort\"));   // exact <wsdl:port name=\"\"> from the WSDL","handlingStrategy":"validation","validationCode":"// Pre-validate the port against the parsed service before setPort\njavax.wsdl.Service svc = wsdl.getService();\nif (svc == null || svc.getPort(portName.getLocalPart()) == null) {\n  throw new IllegalArgumentException(\"Port '\" + portName.getLocalPart()\n    + \"' not found in service '\" + svc.getQName() + \"'; available: \" + svc.getPorts().keySet());\n}\nwsdl.setPort(portName);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy port names directly from the <wsdl:port name=\"\"> attribute, never by memory","Confirm the configured service name actually contains the port","Re-fetch WSDLs after service-side changes"],"tags":["wsdl","soap","configuration","illegal-argument"],"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"}