This content has been marked as final.
Show 2 replies
-
1. Re: Is it possible to create JBoss web service without EJB?
peterj Jul 30, 2012 2:39 PM (in response to ingvarwolf)Yes you can. Just package the web service in a WAR and deploy. Here's a simple class for a hello web service:
package my.web.service; import javax.jws.WebService; import javax.jws.WebMethod; @WebService() public class Hello { @WebMethod() public String hello(String name) { return "Hello " + name; } }
and here is the web.xml for it:
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5" > <servlet> <servlet-name>Hello</servlet-name> <servlet-class>my.web.service.Hello</servlet-class> </servlet> <servlet-mapping> <servlet-name>Hello</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping> </web-app>
-
2. Re: Is it possible to create JBoss web service without EJB?
ingvarwolf Jul 30, 2012 3:42 PM (in response to peterj)Thank you!
Where was my head?! I completely forgot about WAR and was dealing with JAR...
Thank you very much.