axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R J Scheuerle Jr" <sc...@us.ibm.com>
Subject Re: Java2Wsdl Element Name & Complex Type Name issue
Date Fri, 30 Nov 2001 21:27:10 GMT
That sounds fine with me.  I will let you work on this.
I especially want to get closer to roundtrip behavior so that I can write
some testcases.

Some comments:

1)  Your solution only affects the element name.  I assume that you don't
want to mangle the complexType name (by appending Type).

2) You will need another table to make sure duplicate elements are not
created.


Rich Scheuerle
XML & Web Services Development
512-838-5115  (IBM TL 678-5115)


                                                                                         
             
                    Ravi Kumar                                                           
             
                    <rkumar@borlan       To:     axis-dev@xml.apache.org              
                
                    d.com>               cc:                                          
                
                                         Subject:     Re: Java2Wsdl  Element Name & Complex
Type Name  
                    11/30/2001            issue                                          
             
                    02:31 PM                                                             
             
                    Please respond                                                       
             
                    to axis-dev                                                          
             
                                                                                         
             
                                                                                         
             



Rich,

I have been looking at this and would like to approach as follows (the
rationale follows right after):

1. ParamNameResolver interface
2. With atleast one method, as follows
  String getParamName(Class cls, Method method, int parameterTypesIndex);
3. A mechanism to register an implementation of the  ParamNameResolver
4. Then modify Emitter to call this getParamName at the relevant places
       writeRequestMessage() and writeResponseMessage().
    This is if there is a resolver registered
5. if getParamName returns a non-null value, pass it to the Types code to
an
overloaded writePartType() and writeTypeAsElement(). Use this as paramName,
instead of generateUniqueElementName()
6. if getParamName returns null, then do as you have suggested or some
variation that we all agree too

Now, to the rationale.

There are several situations where it's possible to get at the actual
parameter names, albeit need to have some kind of a src / class reader or
some such mechanism. Some examples
1. When the source is available
2. When the class file has debug info, particularly with a local variables
table.
3. Need to use a different naming scheme than the default one, etc

In those situations it will be a worthwhile goal to get the WSDL to mirror
the Java method signatures closely.

In the back of mind, I am thinking of roundtrip behaviour and this will be
a
big step towards it

BTW, the default implemention can do
<element name="Foobar" type="Foobar" />
to make it easy on us, I guess :-)

comments?
Ravi
JBuilder Development


R J Scheuerle Jr wrote:

> James brought up the point that the element name in the
> wsdl should match the name of the class (and the complex
> type name should be different):
>
>     public class Foobar {}
>     <complexType name="FoobarType" />
>     <element name="Foobar" type="FoobarType" />
>
> The problem is that the Wsdl2Java looks at the complexType name to
> determine the name of the java class bindings to build.  So I would
> be in favor of using the same name for both:
>
>     public class Foobar {}
>     <complexType name="Foobar" />
>     <element name="Foobar" type="Foobar" />
>
> This makes the Java2Wsdl implementation easier.  Otherwise the code
> would need to determine (when generating the type= attribute) whether
> the type was emitted by the emitter (thus append Type) or is a known type
> (don't append Type).
>
> One caveat:  The Wsdl2Java emitter does not currently support complexType
> and element with
> the same name.  Russell has this on his to-do list.
>
> Thoughts ?
>
> Rich Scheuerle
> XML & Web Services Development
> 512-838-5115  (IBM TL 678-5115)





Mime
View raw message