users@glassfish.java.net

Re: convert Session EJB to web service

From: <glassfish_at_javadesktop.org>
Date: Wed, 22 Aug 2007 13:17:25 PDT

I added @WebService to a session EJB and, rebuilt and redeployed the project and it converted my EJB into a Web service.

For the code given below:

-- cut here --
@Stateless
@WebService
public class HelloSessionBean implements server.HelloSessionLocal {
    
    /** Creates a new instance of HelloSessionBean */
    public HelloSessionBean() {
    }
    
    public String sayHello(String name) {
        return "Hello " + name + " from session bean";
    }
 }
-- cut here --

the Web service endpoint was hosted at: http://localhost:8080/HelloSessionBeanService/HelloSessionBean?wsdl

webservices.xml is optional per JSR 109 MR2. JAXB provides 100% XML Schema support and allows serializing any Javabeans-style classes.

Is there something more to it ?
[Message sent by forum member 'arungupta' (arungupta)]

http://forums.java.net/jive/thread.jspa?messageID=232117