eclipse-ee4j / metro-jax-ws

metro-jax-ws
https://eclipse-ee4j.github.io/metro-jax-ws/
BSD 3-Clause "New" or "Revised" License
68 stars 40 forks source link

wsimport generate wrong wsdlLocation in WebServiceClient #655

Open xck10b2 opened 1 year ago

xck10b2 commented 1 year ago

Based on

https://github.com/eclipse-ee4j/metro-jax-ws/blob/92031958ca55feadac9bfc1055a6cdaad0e9d893/jaxws-ri/tests/unit/testcases/xop/hello/server/hello.wsdl

and the jaxws-maven-plugin

com.sun.xml.ws jaxws-maven-plugin 4.0.1

and following plugin configuration

Configuring mojo execution 'com.sun.xml.ws:jaxws-maven-plugin:4.0.1:wsimport:gen-wsdl-source-parent' with basic configurator (f) bindingDirectory = C:\temp\jaxwssample\src\jaxws (f) destDir = C:\temp\jaxwssample\target\classes (f) disableXmlSecurity = false (f) encoding = UTF-8 (f) extension = false (f) genJWS = false (f) implDestDir = C:\temp\jaxwssample\src\main\java (f) keep = true (f) pluginDescriptor = Component Descriptor: role: 'org.apache.maven.plugin.Mojo', implementation: 'com.sun.xml.ws.jaxws_maven_plugin.HelpMojo', role hint: 'com.sun.xml.ws:jaxws-maven-plugin:4.0.1:help' role: 'org.apache.maven.plugin.Mojo', implementation: 'org.jvnet.jax_ws_commons.jaxws.WsdlGenMojo', role hint: 'com.sun.xml.ws:jaxws-maven-plugin:4.0.1:wsdlgen' role: 'org.apache.maven.plugin.Mojo', implementation: 'org.jvnet.jax_ws_commons.jaxws.MainWsGenMojo', role hint: 'com.sun.xml.ws:jaxws-maven-plugin:4.0.1:wsgen' role: 'org.apache.maven.plugin.Mojo', implementation: 'org.jvnet.jax_ws_commons.jaxws.TestWsGenMojo', role hint: 'com.sun.xml.ws:jaxws-maven-plugin:4.0.1:wsgen-test' role: 'org.apache.maven.plugin.Mojo', implementation: 'org.jvnet.jax_ws_commons.jaxws.MainWsImportMojo', role hint: 'com.sun.xml.ws:jaxws-maven-plugin:4.0.1:wsimport' role: 'org.apache.maven.plugin.Mojo', implementation: 'org.jvnet.jax_ws_commons.jaxws.TestWsImportMojo', role hint: 'com.sun.xml.ws:jaxws-maven-plugin:4.0.1:wsimport-test'

(f) pluginRepos = ... (f) project = MavenProject: xop.hello.server:jaxwssample-v1:0.0.1-SNAPSHOT @ C:\temp\jaxwssample\pom.xml (f) projectRepos = ... (f) quiet = false (f) repoSession = org.eclipse.aether.DefaultRepositorySystemSession@6af5b246 (f) settings = org.apache.maven.execution.SettingsAdapter@31723307 (f) sourceDestDir = C:\temp\jaxwssample\src-gen\main (f) staleFile = C:\temp\jaxwssample\target\jaxws\stale (f) verbose = false (f) wsdlDirectory = C:\temp\jaxwssample\src\main\resources\xop\hello\server (f) wsdlLocation = xop/hello/server/* (f) xadditionalHeaders = false (f) xdebug = false (f) xdisableAuthenticator = false (f) xdisableSSLHostnameVerification = false (f) xnoAddressingDataBinding = false (f) xnocompile = true (f) xuseBaseResourceAndURLToLoadWSDL = false

the wsdlLocation attribute of the generated WebServiceClient is not correct: @WebServiceClient(name = "HelloService", targetNamespace = "http://example.org/mtom", wsdlLocation = "file:/C:/temp/jaxwssample/src/main/resources/xop/hello/server/hello.wsdl")

Because we need to generate all wsdl files existing in the declared folder we don't use the wsdlFiles-Element as descriped on https://eclipse-ee4j.github.io/metro-jax-ws/jaxws-maven-plugin/wsimport-mojo.html#wsdlFiles

With com.helger.plugin:jaxws-maven-plugin:2.6 the genaration works fine.

if we add the wsdlElements to our configuration

.. (f) wsdlFiles = [hello.wsdl] ..

the result is correct.

@WebServiceClient(name = "HelloService", targetNamespace = "http://example.org/mtom", wsdlLocation = "xop/hello/server/hello.wsdl")