java wsimport Xauthfile 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7359877/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
wsimport Xauthfile error
提问by Lubos
I am trying to generate the java help classes that I need for a client (a.k.a consumer) for a SSL-protected web service (on Microsoft Biztalk) that is external to our company network. We can access it only over a proxy and we cannot change anything about the Webservice itself.
我正在尝试为我们公司网络外部的受 SSL 保护的 Web 服务(在 Microsoft Biztalk 上)生成客户端(又名消费者)所需的 java 帮助类。我们只能通过代理访问它,我们不能更改 Web 服务本身的任何内容。
This is my command provided to the wsimport tool:
这是我提供给 wsimport 工具的命令:
wsimport -keep -httpproxy:theProxy.net:8080 -s c:\generatedWebService_wsImport\ -p the.java.package.I.want.to.call.it -Xauthfile c:\generatedWebService_wsImport\auth https://meldeservice-test.oekb.at/Meldeservice/WebService_at_oekb_biztalk_MeldeService.asmx?WSDL
and this is the content of my auth file:
而这是我的身份验证文件的内容:
https://user:[email protected]:8080/Meldeservice/WebService_at_oekb_biztalk_MeldeService.asmx?WSDL
And this is the error I get:
而这是我的错误:
[ERROR] Server returned HTTP response code: 401 for URL: https: //meldeservice-test.oekb.at/Meldeservice/WebService_at_oekb_biztalk_MeldeService.asmx?WSDL, "https: //meldeservice-test.oekb.at/Meldeservice/WebService_at_oekb_biztalk_MeldeService.asmx?WSDL" needs authorization, please provide authorization file with read access at C:\Documents and Settings\s6424.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//
[ERROR] 服务器返回 HTTP 响应代码:401 for URL:https://meldeservice-test.oekb.at/Meldeservice/WebService_at_oekb_biztalk_MeldeService.asmx?WSDL, "https://meldeservice-test.oekb.at/Meldeservice/WebService_at_oekb_biztalk_MeldeService. asmx?WSDL" 需要授权,请在 C:\Documents and Settings\s6424.metro\auth 提供具有读取权限的授权文件或使用 -Xauthfile 提供授权文件,并在每一行使用以下格式提供授权信息:http[s ]://用户:密码@主机:端口//
Of course the proxy and credentials are different as in this post. The password contains a special character ! (exclamation mark).
当然,代理和凭据与本文不同。密码包含特殊字符!(感叹号)。
Can someone help me with a working example under similar conditions. I had already searched a lot but couldn't find anything that would have helped me.
有人可以帮助我在类似条件下提供一个工作示例。我已经搜索了很多,但找不到任何可以帮助我的东西。
Is there somewhere a downloadable source code of the wsimport tool? This would be as the last resort to use.
是否有 wsimport 工具的可下载源代码?这将是最后使用的手段。
回答by linkamp
Try to open https://user:[email protected]:8080/Meldeservice/WebService_at_oekb_biztalk_MeldeService.asmx?WSDL
尝试打开https://user:[email protected]:8080/Meldeservice/WebService_at_oekb_biztalk_MeldeService.asmx?WSDL
with your browser and save to local folder. Later you can use a wsimport like this:
使用浏览器保存到本地文件夹。稍后您可以像这样使用 wsimport:
wsimport -keep -s c:\generatedWebService_wsImport\ -p the.java.package.I.want.to.call.it /home/user/Download/example?WSDL
wsimport -keep -sc:\generatedWebService_wsImport\ -p the.java.package.I.want.to.call.it /home/user/Download/example?WSDL
Regards,
问候,
回答by Titi Wangsa bin Damhore
in your request, you used
在您的请求中,您使用了
https://meldeservice-test.oekb.at/Meldeservice/WebService_at_oekb_biztalk_MeldeService.asmx?WSDL
in your auth file, it is
在您的身份验证文件中,它是
meldeservice-test.oekb.at:8080/Meldeservice/WebService_at_oekb_biztalk_MeldeService.asmx?WSDL
try removing the port number, change it to
尝试删除端口号,将其更改为
https://user:[email protected]/Meldeservice/WebService_at_oekb_biztalk_MeldeService.asmx?WSDL