Using authorized URL with JAX-WS in MAVEN

If you want to use the maven plugin jaxws-maven-plugin
with a WSDL url that requires a login name associated to a password,
you need to create a file called authFile in your project's resources.

<configuration>
<packagename>com.xxxx.api</packagename>
<extension>true</extension>
<verbose>true</verbose>
<sourcedestdir>${project.build.directory}/generated-sources/jaxws/wsimport</sourcedestdir>
<wsdlurls>
<wsdlurl>https://mylogin:password@my.private.server/wsdl/services.wsdl</wsdlurl>
</wsdlurls>
<xauthfile>${basedir}/src/main/resources/authFile</xauthfile>
</configuration>

And you just have to fill the file authfile with this content :
https://mylogin:password@my.private.server/wsdl/services.wsdl

Then in your console, you will see no more error message and
your WSDL will be retrieve to generate the associated sources.

2 comments:

Post a Comment

Copyright © IT pages