axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas L Gallardo <nlgal...@us.ibm.com>
Subject Re: [Axis2] JSR 181 support
Date Wed, 02 Aug 2006 05:45:39 GMT
Rajith,

After looking at your patch a little more closely, along with the 
WSMService/WSMServiceFactory code, I think there are a few issues that 
will prevent the Axis2 model and the JAX-WS model from being completely 
common.  There may be pieces that they can share though.  Here are some 
thoughts on the patch, and the problem in general. 

- I don't yet know how we're going to solve the problem of determining 
when an annotated class is intended for JAX-WS deployment vs. Axis2.  Say 
for instance a service implementation bean is annotated with just 
@WebService at the class level and @WebMethod for each of the methods.  As 
the deployment is happening, how will we tell whether this is supposed to 
be an Axis2 endpoint or a JAX-WS endpoint?  We'll need to know the 
difference to determine which message receiver to configure, the 
JAXWSMessageReceiver or the RPCMessageReceiver (I'm guessing that's the 
one that would be used).  Since they are both just annotated beans and 
neither implements an interface, I can't figure out what characteristic 
could be used to distinguish between the two.

- On the topic of deployment, you have a comment in the code 
(DeploymentEngine) that asks whether we can ignore the services.xml if we 
know we have a set of annotated Java classes.  While that's the ultimate 
goal, relying on the JSR-181 annotation data alone will not allow you to 
do this.  If the services.xml is ignored, where does the non-WSDL related 
config information that was in there come from?  For example, what if I 
wanted to specify a few module references to enable WS-Addressing and some 
custom module that I've built.  If the services.xml is ignored, then that 
info is lost.  Unless you defined a way to include that in some custom 
Axis2 annotations as well.  That might just be a limitation of the 
scenario though... 

Some comments from a JAX-WS perspective...

- While the WSMService provides the abstraction for the JSR-181 view of 
the data, it cannot currently capture the JAX-WS specific annotation data. 
 JAX-WS defines a set of annotations on top of what is included in JSR-181 
that are required for some of the pretty common scenarios.  Example: for a 
doc/lit wrapped pattern service, there are @RequestWrapper and 
@ResponseWrapper annotations that are required for any method that 
implements the wrapped pattern.

- The WSMServiceFactory has code in it that handles some of the mapping 
rules built in to it.  I didn't dig through in great detail, but noticed a 
few places where it resolves issues between the implementation class 
annotations and the SEI annotations.  My preference would be to have all 
of the rules for JAX-WS built in to our JAX-WS layer.  If we need to make 
changes in there, they become self-contained.  The rules for JAX-WS are 
well-defined and should be strictly maintained.  I would feel a little 
uncomfortable with the possibility that those could change in WSM to 
support a different effort and could break our JAX-WS compliance.

- The utility that you have for scanning the classes with ASM could be 
leveraged in JAX-WS.  We really just need something to quickly tell us 
whether or not this class has annotations.  The rest of the processing 
could then be done with whatever other tool.


A bit of background on what we're doing in the JAX-WS layer.  Right now 
the only place we're doing any form of annotations processing is the in 
the client side code that Nikhil has built up for the dynamic proxy.  This 
is all using reflection and just been scaffolding to get us up and runnig. 
 The longer term goal is what was originally called MDQ, but was recently 
renamed as the ServiceDescriptionFactory.  This will be able to take in 
annotated Java and build the JAX-WS runtime model (which uses the 
AxisService and then includes the JAX-WS specific info).  The 
ServiceDescriptionFactory will also eventually be able to merge the Java 
annotation information with the WSDL info that may or may not have already 
existed to produce a single runtime config.  The only problem is that this 
all has to be done keep the JAX-WS specific rules in mind.  It isn't 
generic enough to support a separate model for Axis2.

Hope that makes sense...

Nicholas Gallardo
WebSphere  -  WebServices Development
nlgallar@us.ibm.com
Phone: 512-838-1182
Building: 901 / 5G-016



"Rajith Attapattu" <rajith77@gmail.com> 
08/01/2006 06:10 PM
Please respond to
axis-dev@ws.apache.org


To
axis-dev@ws.apache.org
cc

Subject
Re: [Axis2] JSR 181 support






Jeff,

Thanks for your comments on the patch.
Yes the validating against an existing WSDL is still outstanding along 
with the following.
(WSM does provide some functionality around this and I hope to leverage 
that) 

I have used the WSM code to process all annotations defined in the spec 
and build a WSM Model.
However when creating an Axis Service based on the WSM model the 
informaiton provided by the following annotations are still not used. 
@SOAPBinding
@HandlerChain
@SOAPMessageHandlers 

Also outstanding
============
generating the WSDL if not specified
Validating against an existing WSDL (if specified using wsdlLocation)

Jeff this patch is just the base and a lot more work needs to be done. The 
current patch can do the following. 
1) use ASM to scan classes marked with @WebService annotation
2) Process all the annotations and build a WSM Model.
3) Build an Axis2 service based on the WSM model. (Only uses information 
provided by @WebService and @WebMethod and @OneWay 
4) Deploy the service.

Hope this helps you to understand the patch more.

Please feel free to ask more questions.

Regards,

Rajith


On 8/1/06, Jeff Barrett <barrettj@us.ibm.com> wrote:

Hello Rajith, 

>From looking at the patch, I was wondering how WSDL and annotations will 
interact with each other. 

It seems to me (from looking at the JSR-181 spec and the JAX-WS spec) that 
annotations might augment information specified in the WSDL.  Specificaly, 
from JSR-181 (version 1.0 June 1, 2005) section 2.2.2 "Start with WSDL" 
states: "...JSR-181 annotations supply implementation details that are 
left out of the original WSDL contract, such as binding or service 
location information." 

It seems that building the AxisService from JSR-181 annotations needs to 
also consider (and merge as well as possibly validate against) WSDL if 
there is any. 

Thanks,
Jeff

IBM Software Group - WebSphere Web Services Development
Phone: 512-838-4587 or Tie Line 678-4587
Internet e-mail and Sametime ID: barrettj@us.ibm.com 



"Rajith Attapattu" <rajith77@gmail.com> 
07/27/2006 02:45 PM 


Please respond to
axis-dev@ws.apache.org


To
axis-dev@ws.apache.org 
cc

Subject
Re: [Axis2] JSR 181 support








Nicholas,

So sorry for the late reply, somehow I have missed it :-(

>>Sorry to jump in the middle here, but can you explain what the meta 
annotation is and from which spec files it would be removed?  I'm assuming 
you're talking >>about the JSR-181 spec annotations declarations, but just 
wanted to make sure.
No need to appologize, sorry for not explaining it properly.

Annogen requires you to add an annotation, which it uses to generate the 
AnnoBeans. 
@AnnogenInfo( 
 annoBeanClass = 
"org.codehaus.annogen.examples.stored_override.DeploymentInfoAnnoBean"
)

So I used the annotation on the spec files. For example on the 
javax.jws.WebService which describes the @WebService annotation. 
However it's illegal to modify a spec file without permission, so what we 
did was to remove the annotation after we generated the necessary 
AnnoBeans.
The generated AnnoBeans were checked into the main source tree (since they 
never change as the spec files are static) 


>>Just for clarity, you are getting those from the WSM jars, correct?
Yes they come with the WSM jars. They will most likely be available in the 
repos from today.

Hope this helps.

Regards,

Rajith

On 7/24/06, Nicholas L Gallardo <nlgallar@us.ibm.com > wrote: 

Rajith, 

Sorry to jump in the middle here, but can you explain what the meta 
annotation is and from which spec files it would be removed?  I'm assuming 
you're talking about the JSR-181 spec annotations declarations, but just 
wanted to make sure. 

Just for clarity, you are getting those from the WSM jars, correct? 

Thanks, 

Nicholas Gallardo
WebSphere  -  WebServices Development
nlgallar@us.ibm.com 
Phone: 512-838-1182
Building: 901 / 5G-016 

"Davanum Srinivas" <davanum@gmail.com > 
07/24/2006 04:52 PM 

Please respond to
axis-dev@ws.apache.org



To
axis-dev@ws.apache.org 
cc

Subject
Re: [Axis2] JSR 181 support










Sounds good to me.

-- dims

On 7/24/06, Rajith Attapattu <rajith77@gmail.com > wrote:
> Dims,
>
> Eddie was suggesting that we remove the meta annotation from the spec 
files
> since we already have the generated code.
> Since the spec file is static we can safely include the generated 
AnnoBeans
> in the main source tree.
>
> If we do that approach we can safely avoid the legal issue :-)
>
> What do u think?
>
> Regards,
>
> Rajith
>
>
> On 7/20/06, Rajith Attapattu <rajith77@gmail.com > wrote:
> >
> > Hi All,
> >
> > I created a deployment hook which uses ASM to scan a jar file thats 
thrown
> into the axis2 repository to identify classes annotated with 
@WebServices.
> > Therefore there is no need for a services.xml to be present in the jar
> file.
> >
> > Currently support for @SOAPBinding, @HandlerChain, 
@SOAPMessageHandlers
> (on Axis2 side, the WSMModel is complete) and generating the WSDL is 
still
> outstanding.
> >
> > Comments/suggestions/reviews are most welcomed.
> >
> > I will wait for a general nod from the community about the direction,
> before I start on any further work.
> >
> > All required patches are attached to AXIS2-883
> >
> > Regards,
> >
> >
> > Rajith
> >
> >
> >
> >
> >
> > On 7/11/06, Eddie O'Neil <ekoneil@gmail.com > wrote:
> > > Rajith--
> > >
> > >   I'm not super familiar with the Axis2 architecture, but in the
> > > absence of both a .aar file and service.xml, is there some default
> > > binding between a URL and a Java class?  If so, the metadata could 
be
> > > checked and processed at runtime to dynamically wire-up a service
> > > based on the shape of a web service implementation class (and 
optional
> > > service endpoint).
> > >
> > >   To close the loop on Dennis's question from a while ago, it *is*
> > > possible to get all of the type declarations that are annotated with 
a
> > > specific annotation.  This method is available here:
> > >
> > >
> 
http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/com/sun/mirror/apt/AnnotationProcessorEnvironment.html#getDeclarationsAnnotatedWith(com.sun.mirror.declaration.AnnotationTypeDeclaration)


> > >
> > > and returns a collection of types (classes, fields, parameters) that
> > > are marked with some annotation.
> > >
> > >   This doesn't really help us for wiring up web services at runtime,
> > > but it makes the build time very easy.
> > >
> > > Eddie
> > >
> > >
> > > On 7/11/06, Rajith Attapattu <rajith77@gmail.com > wrote:
> > > > Hi Guillaume,
> > > >
> > > > if the service deployed as an ".aar" then we know which classes to
> > > > introspect or use ASM.
> > > > If there is a service.xml then we can easily figure out what the 
class
> is.
> > > > The above approach will make life easier.
> > > >
> > > > But I think the expectation is that service.xml is optional.
> > > > Also there maybe an expectation that the annotated POJO's need not 
be
> > > > deployed as an ".aar"
> > > >
> > > > I maybe wrong here, but it would be interesting to know what the
> expectation
> > > > is within the community.
> > > > ideas/comments please?
> > > >
> > > > Regards,
> > > >
> > > > Rajith
> > > >
> > > > On 7/11/06, Guillaume Sauthier
> > > > < Guillaume.Sauthier@objectweb.org >
> > > > wrote:GuilGuillaumelaume
> > > > >
> > > > Rajith Attapattu wrote:
> > > > > Hi Dims,
> > > > >
> > > >  > I finnaly managed to get an annotated POJO exposed as an axis2 
web
> > > > > service.
> > > > > Before I submit the patch I need to clarify a few things.
> > > > >
> > > > > 1. We need to figure out a way to find the classes marked with
> > > > > @WebService.
> > > > >     Right now I just have my test POJO hard corded in
> > > > > WSMToAxis2ServiceBuilder to test things.
> > > > >
> > > > >    Ideas? suggestions pls?
> > > > Hi
> > > >
> > > > Basically, you have to introspect deployed services to find 
annotated
> > > > classes.
> > > > Ie : when an aar is deployed (the archive usually with the
> service.xml),
> > > > you can either look at all the classes with reflection, or use ASM 
to
> > > > find annotated classes.
> > > > BTW, Is the service.xml optionnal ?
> > > >
> > > > Regards
> > > > Guillaume
> > > > >   There was a few disscussion, but can we come to an agreement?
> > > > >
> > > > > 2. Generating Annogen beans for meta data (This is more or less 
a
> WSM
> > > > > problem, will cross post there as well)
> > > > >     The annogen task that generates code based on the annotated
> > > > > classes seems to have bug with inner classes.
> > > > >     For example WebParam.Mode gives compilation errors as it 
cannot
> > > > > the handle the inner class
> > > > >     So I eidted the generated source file to get it working.
> > > > >
> > > > >     This maybe an option since the javax.jws classes are static 
and
> > > > > does not need to go through annogen code generation all the 
time.
> > > > >     But it would be nice if this worked so that I can add a task

in
> > > > > wsm to compile the javax.jws classes and generate the required
> > > > > AnnoBeans without manual intervention.
> > > > >
> > > > > Regards,
> > > >  >
> > > > > Rajith
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> axis-dev-unsubscribe@ws.apache.org 
> > > > For additional commands, e-mail: axis-dev-help@ws.apache.org 
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> axis-dev-unsubscribe@ws.apache.org 
> > > For additional commands, e-mail: axis-dev-help@ws.apache.org 
> > >
> > >
> >
> >
>
>


-- 
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org 
For additional commands, e-mail: axis-dev-help@ws.apache.org 





Mime
View raw message