{"record":{"id":"14f11d19bbb2ceb1","repo":"pentaho/pentaho-kettle","slug":"unable-to-read-web-service-response-data-from-input-stream","errorCode":null,"errorMessage":"Unable to read web service response data from input stream","messagePattern":"Unable to read web service response data from input stream","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/webservices/WebService.java","lineNumber":528,"sourceCode":"  private String readStringFromInputStream( InputStream is, String encoding ) throws KettleStepException {\n\n    try {\n\n      StringBuilder sb = new StringBuilder( Math.max( 16, is.available() ) );\n      char[] tmp = new char[ 4096 ];\n\n      try {\n        InputStreamReader reader = new InputStreamReader( is, encoding != null ? encoding : \"UTF-8\" );\n        for ( int cnt; ( cnt = reader.read( tmp ) ) > 0; ) {\n          sb.append( tmp, 0, cnt );\n        }\n      } finally {\n        is.close();\n      }\n      return sb.toString();\n\n    } catch ( Exception e ) {\n      throw new KettleStepException( \"Unable to read web service response data from input stream\", e );\n    }\n\n  }\n\n  private void processRows( InputStream anXml, Object[] rowData, RowMetaInterface rowMeta,\n                            boolean ignoreNamespacePrefix, String encoding ) throws KettleException {\n    // Just to make sure the old transformations keep working...\n    //\n    if ( meta.isCompatible() ) {\n      compatibleProcessRows( anXml, rowData, rowMeta, ignoreNamespacePrefix, encoding );\n      return;\n    }\n\n    // First we should get the complete string\n    // The problem is that the string can contain XML or any other format such as HTML saying the service is no longer\n    // available.\n    // We're talking about a WEB service here.\n    // As such, to keep the original parsing scheme, we first read the content.","sourceCodeStart":510,"sourceCodeEnd":546,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/webservices/WebService.java#L510-L546","documentation":"KettleStepException thrown by WebService.readStringFromInputStream when reading the SOAP response body from the HTTP input stream fails. The method slurps the response into a string; any IOException or stream error during that read is wrapped with this message.","triggerScenarios":"response() -> readStringFromInputStream: connection dropped mid-response, server closes stream prematurely, gzip/compressed content the reader cannot handle, or an encoding/IO error while consuming is.","commonSituations":"Slow or unstable network to the SOAP endpoint; server-side timeout killing the connection mid-body; proxy terminating the connection; very large responses hitting socket timeouts.","solutions":["Retry the transformation; transient connection drops are the most common cause.","Check server/proxy logs around the failure time for aborted responses or timeouts.","Increase HTTP client socket/connect timeouts used by getHttpClient().","Verify the endpoint URL and TLS config; a server that resets connections (e.g. wrong scheme) can abort the stream."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Probe connectivity before the run:\nHttpURLConnection c = (HttpURLConnection) new java.net.URL(endpoint).openConnection();\nc.setConnectTimeout(5000); c.setReadTimeout(30000);\nif (c.getResponseCode() >= 400) throw new IllegalStateException(\"Endpoint unhealthy: \" + c.getResponseCode());","typeGuard":null,"tryCatchPattern":"try {\n  // run transformation\n} catch (KettleStepException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"read web service response\")) {\n    // retry with backoff; transient connection drops are typical\n  }\n}","preventionTips":["Set generous socket/connect timeouts on the step's HTTP client.","Monitor network stability between the Pentaho host and the SOAP endpoint.","Check proxy configurations that may terminate long-lived responses."],"tags":["kettle","webservice","io","network"],"backgroundTag":"network-request-failed","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"}