tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Louis MONTEIRO <jean-louis.monte...@atosorigin.com>
Subject Re: Using Stateless Bean as WebService and Remote Interface Both
Date Thu, 30 Apr 2009 12:24:05 GMT

Hi,

I've done some tests around this topic.
I checked over specifications first and I've seen it's a JAX-WS 2.1 feature.

By default, the runtime just examines the exact classes referenced from the
SEI interface to figure out what classes need to be bound into the JAXB
context. A way to change it is to use the JAXB annotation @XmlSeeAlso where
it's needed.

For example:
@WebService
public interface BaseService {
    String echo(String toEcho);
}
@WebService
public interface HelloWorld extends BaseService {
    String sayHi(String text);
}
@WebService(serviceName = "HelloWorld")
@XmlSeeAlso(value = {BaseService.class})
public class HelloWorldImpl implements HelloWorld {

    public String sayHi(String text) {
        return "Hello " + text;
    }

    public String echo(String toEcho) {
	return toEcho;
    }
    
}

But the case is that OpenEJB embeds CXF 2.0.x which does not support JAX-WS
2.1
To support interface inheritance, we have to migrate to CXF 2.1 (min)

I've tested it with CXF (standalone) and it works fine.
But, we can not change CXF version out of the box in OpenEJB because API has
been modified.

I'm working with a colleague to get OpenEJB compiling and running with CXF
2.2.1 (lastest version available).

First results are expected by the end of this week.

Kind regards,
Jean-Louis




David Blevins wrote:
> 
> Ok, this feature is now in.  In OpenEJB 3.1.1 this will work fine:
> 
>      @Local
>      @Remote
>      @WebService
>      public interface Everything {
>          public Object echo(Object o);
>      }
> 
>      public class SuperBean implements Everything {
>          public Object echo(Object o) {
>              return o;
>          }
>      }
> 
> Careful though as combining @Remote and @Local on the same interface  
> is still against the spec and won't be portable.   It'll work fine in  
> OpenEJB, but likely nowhere else.
> 
> When using both @Local and @Remote on the same interface, you will  
> always get the @Local version of the proxy where possible.
> 
> 
> -David
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-Stateless-Bean-as-WebService-and-Remote-Interface-Both-tp22742953p23315250.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message