如何使用的wsimport生成一个Web服务客户端,WSDL需要身份验证? [英] How can I use wsimport to generate a webservice client which wsdl requires authentication?
问题描述
我想使用的wsimport生成一个Web服务客户端,但在WSDL要求身份验证。
I'm trying to generate a webservice client using wsimport, but the wsdl requires authentication.
我用这样的命令:
https://开头的用户名:密码@网址WSDL
不过,这是行不通的。
推荐答案
运行你的命令后你应该得到一个消息,抱怨缺少网络的授权文件。
After running your command you should get a message complaining about a missing web authorization file.
您需要做的就是创建一个授权文件(通常为它的默认名称/位置为$ HOME_DIRECTORY / .metro /权威性,但检查previous错误消息,您会从那里得到暗示) 。
在这个文件中你只写一行:https://开头的用户名:密码@网址WSDL
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"
一旦创建了文件,运行的wsimport命令再次省略了用户名/密码信息,如下所示:
Once the file is created, run the wsimport command again omitting the username/password info, like this:
希望它帮助。
这篇关于如何使用的wsimport生成一个Web服务客户端,WSDL需要身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!