web-services - 具有特殊字符和 Xauthfile 的 wsimport

标签 web-services ssl soapui wsimport xauth

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

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>

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

当我尝试使用 SoapUI 导入 WS 时 tutorial我有一个

[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 文件。我试过了

preferences -> SSL Settings

但运气不好。

就是这样。我会很感激任何帮助。

编辑

好的,所以我通过了授权,使用 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>

最佳答案

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

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

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

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

关于web-services - 具有特殊字符和 Xauthfile 的 wsimport,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27318954/

相关文章:

java - 无法将 ViaPost 发送到 Axis2 1.6 中的 url

c# - 从 web 服务下载文件 - 在 ASP.NET 站点中

ssl - 无法 `openssl verify' letsencrypt 证书

android - HtpsURLConnection 无法建立连接

wordpress - Nginx反向代理https内容

java - Groovy 摘要身份验证

java - 为什么 JAX-WS 不需要 Web 容器

android - 如何使用 JSON 创建 WEB 服务器

java - 如何让 Java 应用程序接受 WS-Security 证书

运行 SoapUIMockServiceRunner 时出现 java.lang.NoSuchMethodError