You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Willem Jiang <ni...@iona.com> on 2006/11/01 09:37:51 UTC

Something about the SEI

Hi,

I just went through the JAX-WS 2.0 specification (Final Release April 
19, 2006) about the SEI , and found there some interesting use cases CXF 
can't treat properly.
Here is how can we get the SEI from implementation class in the Chapter 
3 "Java to WSDL 1.1 Mapping" P30.

" In order to allow for a separation between Web service interface and 
implementation, if the WebService
annotation on the class under consideration has a endpointInterface 
element, then the interface referred
by this element is for all purposes the SEI associated with the class.

Otherwise, the class implicitly defines a service endpoint interface 
(SEI) which comprises all of the public
methods that satisfy one of the following conditions:
1. They are annotated with the javax.jws.WebMethod annotation with the 
exclude element set to
false or missing (since false is the default for this annotation element).
2. They are not annotated with the javax.jws.WebMethod annotation but 
their declaring class has a
javax.jws.WebService annotation.

For mapping purposes, this implicit SEI and its methods are considered 
to be annotated with the same Web
service-related annotations that the original class and its methods have.
In pratice, in order to exclude a public method of a class annotated 
with WebService and not directly
specifying a endpointInterface from the implicitly defined SEI, it is 
necessary to annotate the method
with a WebMethod annotation with the exclude element set to true."

The specification talked about two situations, one is about the  SEI 
defined in the WebService annotation explicitly.
the other is about implicitly definition of SEI.

In CXF, we treat SEI as A interface class which is defined in 
JaxWsImplementorInfo,

 public Class<?> getEndpointClass() {
        Class endpointInterface = getSEIClass();
        if (null == endpointInterface) {
            endpointInterface = getImplementorClass();
        }
        return endpointInterface;
    }

In most cases this definition works fine, but there also some use cases 
we can't treat the SEI class as A kind of interface class.
eg,

@WebService
public class A implements B,C,D

B, C are the interface which are annotated with "WebService".

In CXF, we just can tell B is the SEI , and will forget the all 
"WebMethod" which are defined in the interface C. 
IMO , we should filter all the methods in class A, to tell which method 
is the "WebMethod" as the specification said and The SEI should 
comprises these methods.

Any thoughts?

Willem.

-- 
Willem Jiang
Software Engineer

IONA Asia Pacific Software Development Center
2/F, Unit A, Information Center
Zhongguancun Software Park Haidian District,
Beijing, P.R.China (100094)

Tel: +86-10-82825151 - 523
Fax: +86-10-82825210
Email: ning.jiang@iona.com



Re: Something about the SEI

Posted by Dan Diephouse <da...@envoisolutions.com>.
Hi Willem,

I could be completely wrong, but here is how I understand it. If an
endpointInterface is defined, that interface is used as the SEI.
Otherwise the SEI is the implementation class itself and only the
methods which have an explicit @WebMethod annotation are turned into
operations. So the interfaces of a concrete class are irrelevant to
turning the class into a web service. In your example this means class A
would be used as the basis of the web service and only methods with
@WebMethod would be come operations. Interfaces B, C, and D would not
play a role at all.

- Dan

Jiang, Ning (Willem) wrote:

> Hi Dan,
>
> ASAIK from the specification ,The SEI can be explicitly or implicitly
> defined.You said is the explicit definition which set the
> A's Webservice annontation endpoint interface as B.
>
> But if the SEI is implicitly defined, we should find the Webmethod by
> this way as sepecification said:
>
> "Otherwise, the class implicitly defines a service endpoint interface
> (SEI) which comprises all of the public
> methods that satisfy one of the following conditions:
> 1. They are annotated with the javax.jws.WebMethod annotation with the
> exclude element set to false or missing
> (since false is the default for this annotation element).
> 2. They are not annotated with the javax.jws.WebMethod annotation but
> their declaring class has a javax.jws.WebService annotation."
>
> And we should not just find an an class B which is the interface of A and
> come with the annonation of WebService to avoid missing C which also
> provides WebMethod.
>
> That is what I want to figure out.
>
> So what's your thought about it?
>
>
> -----Original Message-----
> From: Dan Diephouse [mailto:dan@envoisolutions.com]
> Sent: 11/5/2006 2:46
> To: cxf-dev@incubator.apache.org
> Subject: Re: Something about the SEI
>
> Willem Jiang wrote:
>
> > Hi,
> >
> > I just went through the JAX-WS 2.0 specification (Final Release April
> > 19, 2006) about the SEI , and found there some interesting use cases
> > CXF can't treat properly.
> > Here is how can we get the SEI from implementation class in the
> > Chapter 3 "Java to WSDL 1.1 Mapping" P30.
> >
> > ......
> > In CXF, we treat SEI as A interface class which is defined in
> > JaxWsImplementorInfo,
> >
> > public Class<?> getEndpointClass() {
> > Class endpointInterface = getSEIClass();
> > if (null == endpointInterface) {
> > endpointInterface = getImplementorClass();
> > }
> > return endpointInterface;
> > }
> >
> > In most cases this definition works fine, but there also some use
> > cases we can't treat the SEI class as A kind of interface class.
> > eg,
> >
> > @WebService
> > public class A implements B,C,D
> >
> > B, C are the interface which are annotated with "WebService".
>
> >@WebService
> >public Interface B
>
>
> >@WebService
> >public Interface C
>
>
>
>
> I'm confused by this message - if someone exposes class A as a web
> service, it should only be able to have one interface defined as the
> endpoint interface. Say that interface is B. Whats wrong with just using
> that as that should contain all the annotations (with the exception of
> the @WebService.serviceName, which is on class A)?
>
> - Dan
>
> --
> Dan Diephouse
> (616) 971-2053
> Envoi Solutions LLC
> http://netzooid.com
>
>


-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com


RE: Something about the SEI

Posted by "Jiang, Ning (Willem)" <Ni...@iona.com>.
Hi Dan,

ASAIK from the specification ,The SEI can be explicitly or implicitly
defined.You said is the explicit definition which set the 
A's Webservice annontation endpoint interface as B. 

But if the SEI is implicitly defined, we should find the Webmethod by 
this way as sepecification said:

"Otherwise, the class implicitly defines a service endpoint interface 
 (SEI) which comprises all of the public
 methods that satisfy one of the following conditions:
 1. They are annotated with the javax.jws.WebMethod annotation with the 
 exclude element set to  false or missing 
(since false is the default for this annotation element).
 2. They are not annotated with the javax.jws.WebMethod annotation but 
 their declaring class has a  javax.jws.WebService annotation."

And we should not just find an an class B which is the interface of A and
come with the annonation of WebService to avoid missing C which also 
provides WebMethod.

That is what I want to figure out.

So what's your thought about it? 


-----Original Message-----
From: Dan Diephouse [mailto:dan@envoisolutions.com]
Sent: 11/5/2006  2:46
To: cxf-dev@incubator.apache.org
Subject: Re: Something about the SEI
 
Willem Jiang wrote:

> Hi,
>
> I just went through the JAX-WS 2.0 specification (Final Release April 
> 19, 2006) about the SEI , and found there some interesting use cases 
> CXF can't treat properly.
> Here is how can we get the SEI from implementation class in the 
> Chapter 3 "Java to WSDL 1.1 Mapping" P30.
>
> ......
> In CXF, we treat SEI as A interface class which is defined in
> JaxWsImplementorInfo,
>
> public Class<?> getEndpointClass() {
>        Class endpointInterface = getSEIClass();
>        if (null == endpointInterface) {
>            endpointInterface = getImplementorClass();
>        }
>        return endpointInterface;
>    }
>
> In most cases this definition works fine, but there also some use
> cases we can't treat the SEI class as A kind of interface class.
> eg,
>
> @WebService
> public class A implements B,C,D
>
> B, C are the interface which are annotated with "WebService".

>@WebService
>public Interface B 


>@WebService
>public Interface C 




I'm confused by this message - if someone exposes class A as a web 
service, it should only be able to have one interface defined as the 
endpoint interface. Say that interface is B. Whats wrong with just using 
that as that should contain all the annotations (with the exception of 
the @WebService.serviceName, which is on class A)?

- Dan

-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com



Re: Something about the SEI

Posted by Dan Diephouse <da...@envoisolutions.com>.
Willem Jiang wrote:

> Hi,
>
> I just went through the JAX-WS 2.0 specification (Final Release April 
> 19, 2006) about the SEI , and found there some interesting use cases 
> CXF can't treat properly.
> Here is how can we get the SEI from implementation class in the 
> Chapter 3 "Java to WSDL 1.1 Mapping" P30.
>
> " In order to allow for a separation between Web service interface and 
> implementation, if the WebService
> annotation on the class under consideration has a endpointInterface 
> element, then the interface referred
> by this element is for all purposes the SEI associated with the class.
>
> Otherwise, the class implicitly defines a service endpoint interface 
> (SEI) which comprises all of the public
> methods that satisfy one of the following conditions:
> 1. They are annotated with the javax.jws.WebMethod annotation with the 
> exclude element set to
> false or missing (since false is the default for this annotation 
> element).
> 2. They are not annotated with the javax.jws.WebMethod annotation but 
> their declaring class has a
> javax.jws.WebService annotation.
>
> For mapping purposes, this implicit SEI and its methods are considered 
> to be annotated with the same Web
> service-related annotations that the original class and its methods have.
> In pratice, in order to exclude a public method of a class annotated 
> with WebService and not directly
> specifying a endpointInterface from the implicitly defined SEI, it is 
> necessary to annotate the method
> with a WebMethod annotation with the exclude element set to true."
>
> The specification talked about two situations, one is about the  SEI 
> defined in the WebService annotation explicitly.
> the other is about implicitly definition of SEI.
>
> In CXF, we treat SEI as A interface class which is defined in 
> JaxWsImplementorInfo,
>
> public Class<?> getEndpointClass() {
>        Class endpointInterface = getSEIClass();
>        if (null == endpointInterface) {
>            endpointInterface = getImplementorClass();
>        }
>        return endpointInterface;
>    }
>
> In most cases this definition works fine, but there also some use 
> cases we can't treat the SEI class as A kind of interface class.
> eg,
>
> @WebService
> public class A implements B,C,D
>
> B, C are the interface which are annotated with "WebService".
>
> In CXF, we just can tell B is the SEI , and will forget the all 
> "WebMethod" which are defined in the interface C. IMO , we should 
> filter all the methods in class A, to tell which method is the 
> "WebMethod" as the specification said and The SEI should comprises 
> these methods.
>
> Any thoughts?
>
> Willem.
>
I'm confused by this message - if someone exposes class A as a web 
service, it should only be able to have one interface defined as the 
endpoint interface. Say that interface is B. Whats wrong with just using 
that as that should contain all the annotations (with the exception of 
the @WebService.serviceName, which is on class A)?

- Dan

-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com