【问题标题】:wsimport with special character and Xauthfile带有特殊字符和 Xauthfile 的 wsimport
【发布时间】:2014-12-05 15:12:35
【问题描述】:

我和这里的这个人面临同样的问题:

wsimport Xauthfile error

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

我正在使用 ubuntu 并安装了来自 java oracle 的 JDK7。

我正在使用第三方网络服务。由于“@ ”。点 (...) 代表我的密码的其余部分。

这是我正在运行的命令:

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>

【问题讨论】:

    标签: web-services ssl soapui wsimport xauth


    【解决方案1】:

    我使用的是 Apache axis2 而不是 wsimport。首先这个问题发生在我身上,我写了一个 bash 脚本,它工作了。

    #!/bin/bash
    /axis2-1.7.9/bin/wsdl2java.sh -uri http://username:password@domain/x?wsdl 
    

    我还通过“url编码”使用编码密码和用户名,如下所示:

    @#%g3E99! -(网址编码)-> %40%23%25g3E99%21

    【讨论】:

      【解决方案2】:

      首先创建 auth.txt 文件,你需要将以下内容放入并保存到 C 盘:

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

      现在运行以下命令:

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

      这对我有用。

      【讨论】:

        猜你喜欢
        • 2014-10-28
        • 1970-01-01
        • 2023-03-14
        • 2012-10-06
        • 2018-11-14
        • 2012-09-15
        • 2017-03-15
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多