Re: WSDL2Java numeric suffixes to class names

2008-01-09 Thread Richard Gaywood
On Jan 9, 2008 4:46 AM, Amila Suriarachchi <[EMAIL PROTECTED]>
wrote:

> Please try with a nightly build. There was a jira regarding this and now
> for Elements it appends suffix E.
>

Ah yes, that works perfectly! Thanks for your response.


Re: WSDL2Java numeric suffixes to class names

2008-01-08 Thread Amila Suriarachchi
Please try with a nightly build. There was a jira regarding this and now for
Elements it appends suffix E.

thanks,
Amila.

On Jan 8, 2008 9:01 PM, Richard Gaywood <[EMAIL PROTECTED]> wrote:

> Hello list!
>
> I'm using WSDL2Java to reverse engineer Java classes from a WSDL web
> service; I'm using Axis2 1.3 to do this. The web service in question is
> written by some .Net using colleagues of mine and as the only Java guy
> around here I've been asked to look it over before any of our Java using
> customers seeit. It all works swimmingly -- they were very impressed how all
> the data validation rules came over from the XSD correctly -- with one
> exception I've found so far.
>
> The web service in question defines lots of different types and then uses
> an instance of these types with the same name as the type itself. For
> example, in one of the sub XSD files referenced by the WSDL, I have the
> following ComplexType and Element defintions for one of the data types, the
> Locale of a geographical point:
>
> 
> ...
>   
> 
>   This type is used to define where somewhere
> actually is.
> 
> 
>   
> 
>   Reference to the city where the parent entity
> resides.
> 
>   
>   
> 
>   The district in the city where the entity
> resides.
> 
>   
>   
> 
>   Reference to the city where the parent entity
> resides.
> 
>   
> 
>   
> ...
>   
> 
>   Instance of Locale which defines where the parent
> entity resides.
> 
>   
> ...
> 
>
> There are more ComplexType and SimpleType defintions, and more Element
> defintions, where I have put "..." in.
>
> When I reverse engineer this through WSDL2Java, I get two classes: one,
> Locale.java, is the ComplexType declaration. The other is called
> Locale120.java and is the instance of the datatype defined in the
> xs:element tag; in the class, I see:
> protected net.ctg.schemas.v3_0.geography.Locale localLocale;
> i.e. the Locale120 class contains an instance of the Locale class. This
> makes sense to me.
>
> As far as I can see this all works perfectly with only one problem. I can
> understand that Axis had to change one of the two class names to avoid a
> conflict, but where did the number "120" come from? I'm concerned that, if I
> developed to the classes that come out of WSDL2Java, I would write code that
> performed work on Locale120.java; then, when a new version of the web
> service shipped and I regenerated my Java data classes, that "120" value may
> change and all my existing code against those classes would break. It would
> be ideal if I could specify the suffix, just the fixed string "Value" or
> something similar would do the job.
>
> So, am I right in thinking there is a problem here, and what can I do to
> address it? Is the underlying WSDL wrong or can I adjust Axis's behaviour to
> get around the problem?
>
>
>
>
>
>
>


-- 
Amila Suriarachchi,
WSO2 Inc.


WSDL2Java numeric suffixes to class names

2008-01-08 Thread Richard Gaywood
Hello list!

I'm using WSDL2Java to reverse engineer Java classes from a WSDL web
service; I'm using Axis2 1.3 to do this. The web service in question is
written by some .Net using colleagues of mine and as the only Java guy
around here I've been asked to look it over before any of our Java using
customers seeit. It all works swimmingly -- they were very impressed how all
the data validation rules came over from the XSD correctly -- with one
exception I've found so far.

The web service in question defines lots of different types and then uses an
instance of these types with the same name as the type itself. For example,
in one of the sub XSD files referenced by the WSDL, I have the following
ComplexType and Element defintions for one of the data types, the Locale of
a geographical point:


...
  

  This type is used to define where somewhere actually
is.


  

  Reference to the city where the parent entity
resides.

  
  

  The district in the city where the entity
resides.

  
  

  Reference to the city where the parent entity
resides.

  

  
...
  

  Instance of Locale which defines where the parent
entity resides.

  
...


There are more ComplexType and SimpleType defintions, and more Element
defintions, where I have put "..." in.

When I reverse engineer this through WSDL2Java, I get two classes: one,
Locale.java, is the ComplexType declaration. The other is called
Locale120.java and is the instance of the datatype defined in the xs:element
tag; in the class, I see:
protected net.ctg.schemas.v3_0.geography.Locale localLocale;
i.e. the Locale120 class contains an instance of the Locale class. This
makes sense to me.

As far as I can see this all works perfectly with only one problem. I can
understand that Axis had to change one of the two class names to avoid a
conflict, but where did the number "120" come from? I'm concerned that, if I
developed to the classes that come out of WSDL2Java, I would write code that
performed work on Locale120.java; then, when a new version of the web
service shipped and I regenerated my Java data classes, that "120" value may
change and all my existing code against those classes would break. It would
be ideal if I could specify the suffix, just the fixed string "Value" or
something similar would do the job.

So, am I right in thinking there is a problem here, and what can I do to
address it? Is the underlying WSDL wrong or can I adjust Axis's behaviour to
get around the problem?