users@glassfish.java.net

Re: convert Session EJB to web service

From: Dies Koper <dies_at_jp.fujitsu.com>
Date: Thu, 23 Aug 2007 09:22:28 +0900

Yes, on the server side that's it.
Just be careful not to deploy a WAR module with a context root like the
one generated for your Web service endpoint below. GlassFish will let
you do it without warning, and your endpoint will become inaccessible to
your clients (HTTP Status 500 - WEB0502: No ad-hoc servlet configured to
process ad-hoc path), replaced by the new servlet app.


glassfish_at_javadesktop.org wrote:
> 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
>