简体   繁体   English

简单的webservice示例tomEE无法正常工作

[英]Simple webservice example tomEE not working

I'm trying to deploy the simple WS example from tomEE: http://openejb.apache.org/examples-trunk/simple-webservice/ 我正在尝试从tomEE部署简单的WS示例: 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+ 机器:Win7,Eclipse,服务器:tomEE +

-created new Dynamic Web Project with runtime target = the tomcat tomEE server 创建运行时目标的新动态Web项目= tomcat tomEE服务器

-created new package in /src, and added 3 classes there: Calculator , CalculatorWS , CalculatorTest . 在/ src中创建了新的包,并在那里添加了3个类: CalculatorCalculatorWSCalculatorTest

-rightclick project > run as > run on server > choose tomEE. -rightclick项目>运行方式>在服务器上运行>选择tomEE。

Server starts up, launches http://127.0.0.1:8080/testproject 服务器启动,启动http://127.0.0.1:8080/testproject

Which results in 404, as I have not set up any jsf page. 这导致404,因为我没有设置任何jsf页面。 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. 无论如何,转到http://localhost:8080/testproject/Calculator?wsdlhttp://localhost:8080/testproject/webservices/Calculator?wsdl如示例所示,我也找不到404。 Obvious the Webservices are not deployed? 显然Web服务没有部署?

What could be wrong with this basic and simple example? 这个基本而简单的例子有什么问题?

I am using eclipse indigo and tomee 1.5.2. 我正在使用eclipse indigo和tomee 1.5.2。 I have a class xyzMyWS. 我有一个类xyzMyWS。 It's annotated with @WebService and @Stateless. 它使用@WebService和@Stateless进行注释。

The apache tomee log, during startup, says 在启动期间,apache tomee日志说

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

So the WSDL is 所以WSDL就是

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

Please check your logs. 请检查您的日志。

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. 解决方案实际上是查看日志的catalina日志的Apache Logs文件夹,以及今天日期的stderr文件。 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. 在我的例子中,我使用的是JDEV,因此我删除了@Stateless注释,并尝试将.jar放入webapps文件夹中。 That did not work. 没用 However, putting it back in, and dropping the .jar worked fine. 然而,把它放回去,并放弃.jar工作正常。

As a web application (.war), the .class files were moved into WEB-INF\\classes within the .war file and I dropped that into webapps. 作为Web应用程序(.war),.class文件被移动到.war文件中的WEB-INF \\ classes中,然后将其放入webapps中。 I looked at the Catalina Log and it said where the endpoint was (for the wsdl). 我查看了Catalina Log,它说端点在哪里(对于wsdl)。 I typed: http://localhost:8080/SimpleWebService/Calculator?wsdl , and the WSDL file appeared. 我键入: http:// localhost:8080 / SimpleWebService / Calculator?wsdl ,出现了WSDL文件。

After that, I ran some simple Soap Requests with soap ui. 之后,我用肥皂ui运行了一些简单的Soap Requests。 It worked fine. 它工作正常。 this was with version 1.7.1. 这是1.7.1版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM