我面临着与这个人相同的问题:


  wsimport Xauthfile error


由于他没有提供反馈,而且我是新来的,所以不能问他是否解决了他的问题,所以我要提出一个新问题。

我正在使用ubuntu并从Java oracle安装了JDK7。

我正在使用第三方Web服务。 Web服务的密码(... GT @#ED ...)的字符与de -Xauthfile语法(http [s]:// user:password @ host:port //)冲突,因为“ ”。点(...)代表密码的其余部分。

这是我正在运行的命令:

wsimport -p loa -Xauthfile "path_to_auth.txt" https://myWS?wsdl


在我的auth.txt文件中,我有:

https://user:...GT@#ED...@myWS?wsdl


作为回报

parsing WSDL...
[ERROR] Server returned HTTP response code: 401 for URL: https://myWS?wsdl,
"https://myWS?wsdl" needs authorization, please provide authorization file with
read access at /home/user_name/.metro/auth or use -Xauthfile to give the
authorization file and on each line provide authorization information using this
format : http[s]://user:password@host:port//<url-path>


我在网上搜索,但没有成功。

当我尝试像这样在tutorial中使用SoapUI导入WS时,

[ERROR] sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid
certification path to requested target


而且我不知道在哪里为SoapUI指定ssl文件。我尝试了


  首选项-> SSL设置


但没有运气。

而已。我会很感激的。

编辑

确定,因此我通过了授权,使用HTML URL Encoding Reference更改了字符,但是现在出现以下错误

[ERROR] Server redirected too many  times (20),  "https://ws?wsdl" needs
authorization, please provide authorization file with read access at /home/user
/.metro/auth or use -Xauthfile to give the authorization file and on each line
provide authorization information using this format :
http[s]://user:password@host:port//<url-path>

最佳答案

首先创建auth.txt文件,您需要在其中放置以下内容并将其保存在C驱动器中:

http://username:password@localhost:port/wsdlurl


现在运行以下命令:

wsimport -Xauthfile C:\auth.txt -keep http://example.com/test?wsdl


这对我有用。

10-06 15:00