You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Morris Ang <mo...@gmail.com> on 2016/07/11 18:47:54 UTC

Web service Example+request

Hi,

I’m currently learning web services. I have a question about simple_webservice example. I’ve downloaded Tomee+ so that it includes JAX-WS. Why is there a need to use a stateless EJB for web services to work in Tomee+? Is it necessary to use EJB as web service for Tomee? I’ve tried running it without @Stateless and even tried to create my own simple class without it but I keep getting the following:

	SEVERE - Error deploying CXF webservice for servlet com.service.MyService
	javax.xml.ws.WebServiceException: Service resource injection failed

I’ve tried with Wildfly and all I have to do is annotate my POJO with @Webservice.

I’m also confused as to how to generate WSDL or the java source. I’m using IntelliJ and I can’t add a CXF engine. I thought Tomee+ already includes CXF? Do I need to download CXF separately along with Tomee+ for web service support? 


Re: Web service Example+request

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

tomee+ includes CXF so nothing to add.

To configure a pojo webservice just define the webservice as a servlet in
web.xml to map it like in
https://github.com/apache/tomee/blob/master/examples/pojo-webservice/src/main/webapp/WEB-INF/web.xml


To get the wsld just add ?wsdl to the URL logged at startup


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-07-11 20:47 GMT+02:00 Morris Ang <mo...@gmail.com>:

> Hi,
>
> I’m currently learning web services. I have a question about
> simple_webservice example. I’ve downloaded Tomee+ so that it includes
> JAX-WS. Why is there a need to use a stateless EJB for web services to work
> in Tomee+? Is it necessary to use EJB as web service for Tomee? I’ve tried
> running it without @Stateless and even tried to create my own simple class
> without it but I keep getting the following:
>
>         SEVERE - Error deploying CXF webservice for servlet
> com.service.MyService
>         javax.xml.ws.WebServiceException: Service resource injection failed
>
> I’ve tried with Wildfly and all I have to do is annotate my POJO with
> @Webservice.
>
> I’m also confused as to how to generate WSDL or the java source. I’m using
> IntelliJ and I can’t add a CXF engine. I thought Tomee+ already includes
> CXF? Do I need to download CXF separately along with Tomee+ for web service
> support?
>
>