How can I use wsimport to generate a webservice client which wsdl requires authentication?

后端 未结 2 2090
自闭症患者
自闭症患者 2020-12-17 17:53

I\'m trying to generate a webservice client using wsimport, but the wsdl requires authentication.

I\'m using a command like this: wsimport https://username:password@

相关标签:
2条回答
  • 2020-12-17 18:21
    wsimport -Xauthfile C:\resources\META-INF\auth.conf https://url?wsdl
    

    auth.conf

    https://USERNAME:PASWORD@url?wsdl
    
    0 讨论(0)
  • 2020-12-17 18:28

    After running your command you should get a message complaining about a missing web authorization file.

    What you need to do is create an authorization file (usually the default name/location for it is $HOME_DIRECTORY/.metro/auth, but check the previous error message, you'll get the hint from there). Inside this file you just write the line: "https://username:password@url?wsdl"

    Once the file is created, run the wsimport command again omitting the username/password info, like this:

    wsimport https://url?wsdl

    Hope it helps.

    0 讨论(0)
提交回复
热议问题