This thread is pretty old but in case someone pass by I share my experience.
For NTLM you do not need file auth.txt
TL;TR
Use tools.jar com.sun.tools.internal.ws.WsImport
and add Java options "-Dhttp.auth.ntlm.domain=MYDOMAIN" "-Djdk.http.ntlm.transparentAuth=allHosts"
before if you use Java greater than 1.8.0_181
.
Long version
Until Java 1.8.0_181
, NTLM was enabled by default but it's not the case anymore (current version I use is 1.8.0_222
"). See https://stackoverflow.com/a/54628051/349228
To be able to use NTLM with wsimport
tool I had to use the tools.jar
manually :
java "-Dhttp.auth.ntlm.domain=MYDOMAIN" "-Djdk.http.ntlm.transparentAuth=allHosts" -cp %JAVA_HOME%\lib\tools.jar com.sun.tools.internal.ws.WsImport -p "my.target.package.name" -d . -keep -encoding UTF-8 "http://navisionhost:7047/DynamicsNAV110/WS/Test 01/Page/MyPage"
Key part for NTLM is the 2 java options "-Dhttp.auth.ntlm.domain=MYDOMAIN" "-Djdk.http.ntlm.transparentAuth=allHosts"
. The rest is close to the native tool call except we run the Main Java Class from this jar %JAVA_HOME%\lib\tools.jar
manually.