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