Peter Johnson [https://community.jboss.org/people/peterj] created the discussion

"Re: Is it possible to create JBoss web service without EJB?"

To view the discussion, visit: https://community.jboss.org/message/751059#751059

--------------------------------------------------------------
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>
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/751059#751059]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to