You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by arikgold <go...@gmail.com> on 2012/03/26 16:39:22 UTC
java2ws - Java class name differs from complex type name in the xsd
Hi,
I generate a wsdl and xsd files from java classes using java2ws.
I have a class named "MyClass"
The xsd output contains a complexType named "myClass" - *The initial letter
converted to lower case*
Is there any configuration parameter for keeping the complex type name
identical to the class name?
(Using @XmlType annotation is a workaround, but I don't want to add it in
every class I develop)
Thanks in advance,
Arik Goldstein
--
View this message in context: http://cxf.547215.n5.nabble.com/java2ws-Java-class-name-differs-from-complex-type-name-in-the-xsd-tp5595416p5595416.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: java2ws - Java class name differs from complex type name in the xsd
Posted by Mark Streit <mc...@gmail.com>.
FWIW ... Use of the annotation noted by Daniel (XmlType) is something we
have always done on nearly every one of the custom types our environment
uses.
@XmlType(name = "Group", namespace = "http://groups.vo.common.acme.com/")
Where the namespace attribute value is explicitly reversed from the
declared package name on the class.
package com.acme.common.vo.groups;
That is just our standard practice and has worked for a couple of hundred
services we run.
Mark
On Mar 26, 2012 10:54 AM, "Daniel Kulp" <dk...@apache.org> wrote:
> On Monday, March 26, 2012 07:39:22 AM arikgold wrote:
> > Hi,
> >
> > I generate a wsdl and xsd files from java classes using java2ws.
> > I have a class named "MyClass"
> > The xsd output contains a complexType named "myClass" - *The initial
> > letter converted to lower case*
>
> This is per JAXB specification. Section 8.12.1 states:
>
> class name: a class name is mapped to an XML name by de capitalization
> using java.beans.Introspector.decapitalize(classname).
>
> There isn't really a way to change that except for the XmlType annotation.
>
> Dan
>
>
> >
> > Is there any configuration parameter for keeping the complex type name
> > identical to the class name?
> > (Using @XmlType annotation is a workaround, but I don't want to add it in
> > every class I develop)
> >
> > Thanks in advance,
> > Arik Goldstein
> >
> > --
> > View this message in context:
> >
> http://cxf.547215.n5.nabble.com/java2ws-Java-class-name-differs-from-comp
> > lex-type-name-in-the-xsd-tp5595416p5595416.html Sent from the cxf-user
> > mailing list archive at Nabble.com.
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
>
Re: java2ws - Java class name differs from complex type name in the xsd
Posted by Daniel Kulp <dk...@apache.org>.
On Monday, March 26, 2012 07:39:22 AM arikgold wrote:
> Hi,
>
> I generate a wsdl and xsd files from java classes using java2ws.
> I have a class named "MyClass"
> The xsd output contains a complexType named "myClass" - *The initial
> letter converted to lower case*
This is per JAXB specification. Section 8.12.1 states:
class name: a class name is mapped to an XML name by de capitalization
using java.beans.Introspector.decapitalize(classname).
There isn't really a way to change that except for the XmlType annotation.
Dan
>
> Is there any configuration parameter for keeping the complex type name
> identical to the class name?
> (Using @XmlType annotation is a workaround, but I don't want to add it in
> every class I develop)
>
> Thanks in advance,
> Arik Goldstein
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/java2ws-Java-class-name-differs-from-comp
> lex-type-name-in-the-xsd-tp5595416p5595416.html Sent from the cxf-user
> mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com