eclipse 错误:选择必须是 WSDL
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10868169/
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
eclipse error: Selection must be WSDL
提问by Sanjay Rao
I am trying to create a simple web service using Apache CXF 2.6 runtime in Tomcat v7 using Java in Eclipse. I am following this tutorial http://www.youtube.com/watch?v=o2Vjs8ylmFM&feature=autoplay&list=ULtSVs_nwD1Ug&playnext=1
我正在尝试使用 Eclipse 中的 Java 在 Tomcat v7 中使用 Apache CXF 2.6 运行时创建一个简单的 Web 服务。我正在关注本教程http://www.youtube.com/watch?v=o2Vjs8ylmFM&feature=autoplay&list=ULtSVs_nwD1Ug&playnext=1
In this video i am following the wizard create a new XML based Web Service in Eclipse.
在本视频中,我将按照向导在 Eclipse 中创建一个新的基于 XML 的 Web 服务。
In the wizard Web Service type is Bottom up Java Bean Web Service. There are two sliders and i want it to indicate Test Service and Test Client to recreate the error i.e Selection must be WSDL which appears at the end of Test Client.
在向导中,Web 服务类型是自下而上 Java Bean Web 服务。有两个滑块,我希望它指示测试服务和测试客户端重新创建错误,即选择必须是出现在测试客户端末尾的 WSDL。
Please help me understand what am i missing ?
请帮助我了解我错过了什么?
采纳答案by John Taylor
hmm I got the same message with CXF 2.7.2
嗯,我在 CXF 2.7.2 上收到了同样的消息
I went back and added annotations within the create a Service Endpoint Interface section of the wizard (I created and SEI) and it worked.
我返回并在向导的创建服务端点接口部分(我创建和 SEI)中添加了注释并且它起作用了。
I think, because neither my implementation nor the service endpoint interface had annotations originally, the WSDL could not be generated and the wizard could not continue, generating a 'Selection must be WSDL' message instead...or at least that is my belief at the moment :)
我认为,因为我的实现和服务端点接口最初都没有注释,所以无法生成 WSDL 并且向导无法继续,而是生成“选择必须是 WSDL”消息……或者至少这是我的信念此时此刻 :)
回答by Sriks
I have got the same Error with CXF 2.7.1. This Error happened When I got 2 Services in WSDL and try to create Web Service Client out of it. I don't know why its showing up weird error because I am generating Client stubs from WSDL only. But when I create with One Service in WSDL, I didn't get any error. Do you know how to handle WSDL when its got 2 Services inside? How to generate Client out of that WSDL.
我在 CXF 2.7.1 上遇到了同样的错误。当我在 WSDL 中获得 2 个服务并尝试从中创建 Web 服务客户端时发生此错误。我不知道为什么它会出现奇怪的错误,因为我只从 WSDL 生成客户端存根。但是当我在 WSDL 中使用 One Service 创建时,我没有收到任何错误。当里面有 2 个服务时,你知道如何处理 WSDL 吗?如何从该 WSDL 生成客户端。
回答by montjoile
I was having the same error and got the thing work by rigth-clicking the java class and selecting new->web service, instead of selecting the java resources package
我遇到了同样的错误,并通过右键单击 java 类并选择 new->web 服务,而不是选择 java 资源包来使事情工作
回答by jasonMcneel
In the wizard Web Service type is Bottom up Java Bean Web Service. There are two sliders and i want it to indicate Test Service and Test Client to recreate the error i.e Selection must be WSDL which appears at the end of Test Client.
在向导中,Web 服务类型是自下而上 Java Bean Web 服务。有两个滑块,我希望它指示测试服务和测试客户端重新创建错误,即选择必须是出现在测试客户端末尾的 WSDL。
Beneath the "Bottom up Java Bean Web Service" you specified a class. Inspect this class' methods. The methods cannot have an unknown (to the web service client's) return values.
在“自下而上的 Java Bean Web 服务”下,您指定了一个类。检查此类的方法。这些方法不能有未知的(对于 Web 服务客户端)返回值。
回答by Lim Ki Dong
I was the same error But I solved it. My case is ... Because class not created. First check your compile class, Build path > output folder. if class not found then Build Path > Order and Export : all check after Project Clean and check compile class. Sorry I'm poor English But Let you know my experience. Good luck !
我是同样的错误但我解决了它。我的情况是......因为没有创建类。首先检查您的编译类,构建路径 > 输出文件夹。如果未找到类,则构建路径 > 订购和导出:在 Project Clean 后全部检查并检查编译类。对不起,我的英语很差,但让你知道我的经历。祝你好运 !
回答by Omkar
I was getting the same error with CXF version 2.6.1. But I tried with CXF version 2.3.11. Now it works :) but not clear why it doesn't work with version 2.6.1.
我在 CXF 2.6.1 版中遇到了同样的错误。但我尝试使用 CXF 2.3.11 版。现在它可以工作了 :) 但不清楚为什么它不适用于 2.6.1 版。
回答by Maciek Tokarczyk
Actually just changing the CXF version helped me. I Recommend to do the same Thanks
实际上只是更改 CXF 版本对我有帮助。我建议做同样的谢谢
回答by Ashish
I am newbie in Java WebService and was also facing the similar issue while following a tutorial
我是 Java WebService 的新手,在学习教程时也遇到了类似的问题
I downgraded the CXF version from 3.1.1 to 2.4.2, cleaned-out the old dependencies and rebuilt the project. And it started working for me.
我将 CXF 版本从 3.1.1 降级到 2.4.2,清除旧的依赖项并重建项目。它开始对我来说有效。
P.S. - I am using JDK 1.7.
PS - 我使用的是 JDK 1.7。