Webservice.wsdl 和凭据

发布于 2024-08-08 07:28:45 字数 1490 浏览 4 评论 0原文

所以我有一个问题正在努力解决。也许一些 Flex 专家可以提供帮助?

我有一个 WebService 实例,它尝试从 JBoss 应用程序服务器加载 WSDL 文件。如果我做这样的事情:

webService = new WebService();
webService.destination = WebService.DEFAULT_DESTINATION_HTTP;
webService.wsdl = "http://<removed>/services/ApiService?wsdl";
webService.loadWSDL();

一切正常。 WSDL 已成功加载,应用程序可以针对 Web 服务调用方法。

问题是当我需要添加一些 HTTP 身份验证时:

webService.setCredentials(userName, password);

此行最终会抛出一个错误,指出凭据仅在 HTTPS 上受支持。好吧,公平地说,无论如何我想使用安全的 HTTPS!

然后我尝试将其更改为这样...

webService = new WebService();
webService.destination = WebService.DEFAULT_DESTINATION_HTTPS;
webService.wsdl = "https://<removed>/services/ApiService?wsdl";
webService.setCredentials(userName, password);
webService.loadWSDL();

现在 WebService 实例无法加载 WSDL。收到的错误是:

[FaultEvent 故障 =[RPC 故障故障字符串 =“HTTP 请求错误”faultCode =“Server.Error.Request”faultDetail =“无法加载 WSDL。如果当前在线,请验证 WSDL 的 URI 和/或格式 ( https:///services/ApiService?wsdl)"] messageId=" 6905CC5B-5317-C4B3-2D12-84647EE648A7" type="fault" bubbles=false cancelable=true eventPhase=2]

我可以在浏览器中很好地访问此 URI,并且它按预期返回 WSDL。

我不是 Flex 开发者(学习者),而是 Java 开发者。我正在尝试将 Flex 作为我们系统的潜在客户端,但这今天给我带来了各种悲伤。谷歌似乎没有给我任何快速的答案,我有点困惑。

关于 StackOverflow 的第一个问题,希望这能有所收获,并帮助其他一些周五晚上在办公室熬夜的可怜的 Java 开发人员:-)

So I've got a bit of an issue I'm trying to work through. Perhaps some Flex guru could assist?

I have a WebService instance that attempts to load a WSDL file from our JBoss Application Server. If I do something like this:

webService = new WebService();
webService.destination = WebService.DEFAULT_DESTINATION_HTTP;
webService.wsdl = "http://<removed>/services/ApiService?wsdl";
webService.loadWSDL();

everything works fine. The WSDL is loaded successfully and the application can invoke methods against the web service.

The issue is when I need to add some HTTP authentication to the mix:

webService.setCredentials(userName, password);

this line ends up throwing an error stating that credentials are only supported on HTTPS. Ok fair enough, I want to use secure HTTPS anyway!

So then I tried to change it up to this...

webService = new WebService();
webService.destination = WebService.DEFAULT_DESTINATION_HTTPS;
webService.wsdl = "https://<removed>/services/ApiService?wsdl";
webService.setCredentials(userName, password);
webService.loadWSDL();

and now the WebService instance cannot load the WSDL. The error received is:

[FaultEvent fault=[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Unable to load WSDL. If currently online, please verify the URI and/or format of the WSDL (https://<removed>/services/ApiService?wsdl)"] messageId="6905CC5B-5317-C4B3-2D12-84647EE648A7" type="fault" bubbles=false cancelable=true eventPhase=2]

I can reach this URI in the browser just fine and it returns the WSDL as expected.

I am not a Flex guy (learning) but instead a Java developer. I am trying out Flex as a potential client to our system but this has caused me all kinds of grief today. Google doesn't appear to have any quick answers for me and I am a bit stumped.

First question on StackOverflow so hopefully this gets a bite somewhere and helps some other poor Java dev staying late in the office on a Friday night :-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟花易冷人易散 2024-08-15 07:28:45

似乎与您的问题相关。我们计划将来使用 https,所以我很想知道您的问题的解决方案。

This seems to be related to your question. We are planning to use https in the future, so I'm curious to know the solution of your problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文