Simple webservice example tomEE not working

大兔子大兔子 提交于 2019-12-20 02:29:18

问题


I'm trying to deploy the simple WS example from tomEE: http://openejb.apache.org/examples-trunk/simple-webservice/

As there is nothing special about it, I will post in detail what I did. Maybe someone sees what I'm doing wrong:

Machine: Win7, Eclipse, Server: tomEE+

-created new Dynamic Web Project with runtime target = the tomcat tomEE server

-created new package in /src, and added 3 classes there: Calculator, CalculatorWS, CalculatorTest.

-rightclick project > run as > run on server > choose tomEE.

Server starts up, launches http://127.0.0.1:8080/testproject

Which results in 404, as I have not set up any jsf page. Anyhow, going to http://localhost:8080/testproject/Calculator?wsdl or http://localhost:8080/testproject/webservices/Calculator?wsdl as the example suggests, I too get 404 not found. Obvious the Webservices are not deployed?

What could be wrong with this basic and simple example?


回答1:


I am using eclipse indigo and tomee 1.5.2. I have a class x.y.z.MyWS. It's annotated with @WebService and @Stateless.

The apache tomee log, during startup, says

INFO: Webservice(wsdl=http://localhost:8080/MyWebApp/webservices/MyWS, qname={http://z.y.x/}MyWSService) --> Ejb(id=MyWS)

So the WSDL is

http://localhost:8080/MyWebApp/webservices/MyWS?wsdl

Please check your logs.




回答2:


I ran this example the other day, and ran into similar issues. The solution is really to look into the Apache Logs folder for the catalina log for the date, and also for the stderr file for today's date. They will tell you if the deployment worked or failed.

In my case, I was using JDEV, so I had removed the @Stateless annotation, and tried just dropping the .jar into the webapps folder. That did not work. However, putting it back in, and dropping the .jar worked fine.

As a web application (.war), the .class files were moved into WEB-INF\classes within the .war file and I dropped that into webapps. I looked at the Catalina Log and it said where the endpoint was (for the wsdl). I typed: http://localhost:8080/SimpleWebService/Calculator?wsdl, and the WSDL file appeared.

After that, I ran some simple Soap Requests with soap ui. It worked fine. this was with version 1.7.1.



来源:https://stackoverflow.com/questions/11854286/simple-webservice-example-tomee-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!