axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cédric Chabanois <CChaban...@cognicase.fr>
Subject RE: Re : Lightweight Skeletons
Date Thu, 17 Jan 2002 13:01:06 GMT
Hi,

Ok, I understand better now. You are right.

But I still have a problem.
I have the following files :
- LIBSOAPNCL_Port.java
- LIBSOAPNCLBindingImpl.java
- LIBSOAPNCLBindingSkeleton (that is a "lightweight skeleton" with init,
getParameterName and getParameterNameStatic methods) 

When i try to get the wsdl with ?wsdl, I still don't have correct parameter
names (but in0,inout0 ...).

I ran Axis in debug mode and I commented the line that searched for impl
class in setClsSmart in  wsdl.fromJava.Emitter (I know this is not a
solution) :
"
            if (implCls == null) {
//
setImplCls(cls.getName().substring(0,cls.getName().indexOf("Skeleton")) +
"Impl");
                if (implCls == null) {
                    setImplCls(cls);  // Use skeleton as implementation
class
                }
            }
"

I could have renamed my implementation class too. It would have worked ...


So it seems there is still a problem with current implementation because to
generate the parameter names, Axis seems to do the following :
Classrep.getParameterNames is called with the parameters : a Method objet
that comes from the interface (LIBSOAPNCL_Port) and implClass that is the
implementation : LIBSOAPNCLBindingImpl
- this function calls getParameterNamesFromSkeleton(method) but method is
not a method from the skeleton but from the interface so it returns null
- it then calls javapUtils.getParameterNames(methods)  (but we will say that
my classes are not compiled with -g)
- then getParameterNamesFromSkeleton is called with the corresponding method
from the implementation class. But it returns null as the implementation
class is not the skeleton !
- then javapUtils is called with method from implementation class


Cédric

> The reason there are 2 getParameterName methods is that the info is
> gathered in 2 different manners.  The runtime has a skeleton 
> object.  It's
> cheaper to call the instance method on that object than to 
> get the static
> method via reflection.  Java2WSDL has a skeleton CLASS and getting the
> static method via reflection is, I believe, cheaper than 
> instantiating that
> class and calling the instance method.  So we have both.
> 
> As for having an init method rather than a static block; if we had the
> static block, then that block would be executed as soon as 
> the class is
> loaded.  There may be times when that class is loaded but 
> getParameterName
> is never called.  In this case, that code would be executed 
> needlessly.  By
> having an init method, this code is executed ONLY when it's needed.
> 
> Russell Butek
> butek@us.ibm.com
> 

Mime
View raw message