[Bug]: Web services lookup - issues on loading WSDL file
- Dominant language
- Java
- Stars
- 1.5k
- Forks
- 476
- Avg merge
- 18h 32m
- Merged PRs (30d)
- 216
Description
### Apache Hop version?
2.11.0
### Java version?
17.0.2
### Operating system
Linux
### What happened?
Choose a test file for the Web services lookup transform: if the WSDL file resides in the `${PROJECT_HOME}` folder, the transform fails because it tries to look for a folder with the URL-escaped braces, e.g. `file:/opt/apache/hop-2.11.0/$%7BPROJECT_HOME%7D/wsdl/my_wsdl_v2.8.wsdl`.
Tentative workaround: select the file (without pressing Open) in the Test file GUI window, copy the composed path and paste it in the URL field. However, when pressing Load the following exception is raised:
```
RuntimeException: Could not load WSDL file:
org.apache.http.client.ClientProtocolException
at org.apache.hop.ui.hopgui.HopGui.main (HopGui.java:354)
at org.apache.hop.ui.hopgui.HopGui.open (HopGui.java:476)
at org.eclipse.swt.widgets.Display.readAndDispatch (Display.java:4517)
at org.eclipse.swt.widgets.Display.runDeferredEvents (Display.java:5065)
at org.eclipse.swt.widgets.Widget.sendEvent (Widget.java:1617)
at org.eclipse.swt.widgets.Display.sendEvent (Display.java:5855)
at org.eclipse.swt.widgets.EventTable.sendEvent (EventTable.java:91)
at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:237)
at org.apache.hop.ui.hopgui.file.pipeline.HopGuiPipelineGraph.mouseUp (HopGuiPipelineGraph.java:940)
at org.apache.hop.ui.hopgui.file.pipeline.HopGuiPipelineGraph.editTransform (HopGuiPipelineGraph.java:3368)
at org.apache.hop.ui.hopgui.file.pipeline.delegates.HopGuiPipelineTransformDelegate.editTransform (HopGuiPipelineTransformDelegate.java:195)
at org.apache.hop.pipeline.transforms.webservices.WebServiceDialog.open (WebServiceDialog.java:1264)
at org.apache.hop.ui.core.dialog.BaseDialog.defaultShellHandling (BaseDialog.java:528)
at org.eclipse.swt.widgets.Display.readAndDispatch (Display.java:4517)
at org.eclipse.swt.widgets.Display.runDeferredEvents (Display.java:5065)
at org.eclipse.swt.widgets.Widget.sendEvent (Widget.java:1617)
at org.eclipse.swt.widgets.Display.sendEvent (Display.java:5855)
at org.eclipse.swt.widgets.EventTable.sendEvent (EventTable.java:91)
at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:265)
at org.apache.hop.pipeline.transforms.webservices.WebServiceDialog$3.widgetSelected (WebServiceDialog.java:889)
at org.apache.hop.pipeline.transforms.webservices.WebServiceDialog.initTreeTabWebService (WebServiceDialog.java:331)
at org.apache.hop.pipeline.transforms.webservices.WebServiceDialog.loadWebService (WebServiceDialog.java:170)
at org.apache.hop.pipeline.transforms.webservices.wsdl.Wsdl. (Wsdl.java:75)
at org.apache.hop.pipeline.transforms.webservices.wsdl.Wsdl.parse (Wsdl.java:356)
at org.apache.hop.pipeline.transforms.webservices.wsdl.Wsdl.readWsdl (Wsdl.java:365)
at org.apache.hop.core.HttpProtocol.get (HttpProtocol.java:81)
at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:56)
at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:108)
at org.apache.http.impl.client.CloseableHttpClient.execute (CloseableHttpClient.java:83)
at org.apache.http.impl.client.InternalHttpClient.doExecute (InternalHttpClient.java:187)
Root cause: ProtocolException: Target host is not specified
```
Tentative workaround of workaround 😅 : add a `file://` marker before the composed path as explained above. This time the exception raised is:
```
RuntimeException: Could not load WSDL file:
org.apache.http.client.ClientProtocolException: URI does not specify a valid host name: file:///work/hop/config/projects/my_project/wsdl/my_wsdl_v2.8.wsdl
URI does not specify a valid host name: file:///work/hop/config/projects/my_project/wsdl/my_wsdl_v2.8.wsdl
Root cause: ClientProtocolException: URI does not specify a valid host name: file:///work/hop/config/projects/my_project/wsdl/my_wsdl_v2.8.wsdl
```
### Issue Priority
Priority: 2
### Issue Component
Component: Hop Gui, Component: Transforms
Contributor guide
Research direction
Start with WebServiceDialog.loadWebService and the Wsdl.readWsdl path shown in the stack trace, then inspect HttpProtocol.get for local WSDL handling. Reproduce with a WSDL under ${PROJECT_HOME} and verify that the Web services lookup transform loads it without URL-escaped project variables or a file:// workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100