0

I am trying to generate the source files from a Navision web service(NTLM authentication) using wsimport.Below is the command wsimport -XdisableSSLHostnameVerification -d generated -s source -Xauthfile auth2.txt -keep "https://XXX.XXX.XXX.XXX:XXXX/XXXell/WS/XXXXLimited/Page/XXXXXOrder"

in auth.txt

http[s]://user:password@host:port//

I am unable to generate the source files.Please help with any link or sample which can help

Any quick help will be appriciated....

venkata
  • 1
  • 1

2 Answers2

1

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.

Maxence
  • 13,148
  • 4
  • 29
  • 28
0

just ask the Navision Admin to change the config to use Basic Auth:

How to: Use an Access Key for SOAP and OData Web Service Authentication

Cheers

azatoth
  • 705
  • 6
  • 14