Web 服务客户端 - 选择的服务定义无效

发布于 2024-12-23 03:32:42 字数 378 浏览 0 评论 0原文

我正在使用 Apache AXIS 2 Webservice 运行时使用 Apache Tomcat 服务器 (apache-tomcat-7.0.23) 在 eclipse 上构建一个 Web 服务,同时在 tomcat 服务器上运行它,它成功地显示该 Web 服务正在运行...

但是在创建 Web 服务客户端时要测试 Web 服务并在服务器定义中使用 wsdl url (http://localhost:9090/Axis2WSTest/services/Converter?wsdl),这给出下面提到的错误并且不允许我创建 Web 服务客户端:

选择的服务定义无效

您能否建议我错误和可能的解决方案?

i am building a web service on eclipse using Apache AXIS 2 Webservice runtime using Apache Tomcat server (apache-tomcat-7.0.23) while running it on tomcat server it sucessfully shows that the web service is running...

But while creating Webservice client to test the web service and using the wsdl url in the server definition (http://localhost:9090/Axis2WSTest/services/Converter?wsdl), this gives below mentioned error and not letting me to create Webservice client:

The service definition selected is invalid

Can you please suggest me the error and possible solution for it?

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

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

发布评论

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

评论(7

╄→承喏 2024-12-30 03:32:42

问题可能是您的 wsdl 需要 http 身份验证。我在 eclipse 中遇到了同样的错误,但这是因为我连接到的服务器需要身份验证并返回 401 错误,所以 eclipse 说它不是 wsdl。 Eclipse 似乎没有提示身份验证的功能,我能够使用相同的 wsdl url 在 netbeans 中生成客户端,因为 netbeans 知道要求身份验证。

从经过 http 身份验证的 wsdl 生成客户端

The problem could be that your wsdl needs http authentication. I was getting the same error in eclipse, but it was because the server I was connecting to needed authentication and was returning a 401 error, so eclipse was saying it wasn't a wsdl. Eclipse doesn't seem to have the functionality to prompt for authentication, I was able to generate a client in netbeans using the same wsdl url because netbeans knows to ask for authentication.

Generate client from http authenticated wsdl

美羊羊 2024-12-30 03:32:42

我整天都在寻找这个问题的答案,通常本地主机将被添加到您的绕过代理列表中,因此您不会遇到错误。

转到窗口-->偏好-->一般-->网络连接并查看 localhost 是否列在您的 proxybypass 列表中。如果您尝试访问外部 wsdl 链接并且您在
有些企业网络有代理防火墙,您必须设置 http 代理/https 代理。

I was searching for the whole day for an answer for this,generally localhost will be added in your bypass proxy list and hence you will not encounter an error.

Go to windows--> preference-->general--> network-connection and see whether localhost is listed in your proxybypass list.If you are trying to access a external wsdl link and you under
some corporate network having proxy firewall you have to set http proxy/https proxy.

演多会厌 2024-12-30 03:32:42

这是您尝试生成客户端存根的方式吗?如果是,只需在 eclipse 中创建一个 java 项目,单击它,然后按 Ctrl+N,选择 Web 服务客户端并输入您的 wsdl url。 (确保您可以通过在浏览器中提供 wsdl url 来访问它)。

Is this how you are trying to generate client stub ?? If yes, just simply create a java project in eclipse, click on it, then press Ctrl+N, select web service client and enter your wsdl url. (make sure you have made sure you can access the wsdl url, by simply giving it in a browser).

梦里南柯 2024-12-30 03:32:42

尝试将 localhost 替换为实际 IP 地址。我面临着同样的问题,它以这种方式对我有用

Try replacing localhost with the actual IP address. I was facing the same problem and it worked for me this way

绝情姑娘 2024-12-30 03:32:42

我有完全相同的情况。对我来说,以下方法有效:

我从 rdp 的响应中得到了线索 - “尝试用实际的 IP 地址替换 localhost。我面临着同样的问题,并且这种方式对我有用”

使用 IP 对我不起作用。对我有用的:

而不是 - http://servername/SomeWebService/Service.asmx?WSDL

将 FQDN 作为服务器名称。例如 -

http://servername.my.company.com/SomeWebService/Service .asmx?WSDL

I had exactly same situation. For me the following worked:

I got the lead from rdp's response - "Try replacing localhost with the actual IP address. I was facing the same problem and it worked for me this way"

Using IP didn't work for me. What worked for me:

Instead of - http://servername/SomeWebService/Service.asmx?WSDL

putting FQDN for servername. For example -

http://servername.my.company.com/SomeWebService/Service.asmx?WSDL

初见 2024-12-30 03:32:42

我遇到了同样的问题,我能够使用 soapUI 生成存根。请遵循 这篇文章。其中包含使用 SOAP UI - AXIS2 WSDL2JAVA 生成 WSDL 的客户端 JAVA 代码。在此之前,请从此处下载apache axis2二进制文件并解压。

I had the same issue and I was able to generate the stubs using soapUI. Please follow the this post. Which contains GENERATING CLIENT JAVA CODE FOR WSDL USING SOAP UI – AXIS2 WSDL2JAVA. Before that please download apache axis2 binary from here and extract it.

妖妓 2024-12-30 03:32:42

我的解决方案是下载 WSDL 文件并将其放入 Eclipse 项目中,然后从项目中选择 .wsdl 文件,而不是粘贴服务 URL。

my solution was to download the WSDL file and place it in the Eclipse project, then instead of pasting the service URL, select the .wsdl file from the project.

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