One other user discovered something similar and it depends on the VERSION of 
JAXB that you are using (or the version included in the JDK).

If you use JAXB 2.1.12 or later, it and CXF usually match (since that is what 
we use).   If you use one of the latest JDK versions, it also includes 2.1.12.  
 
If you an earlier update of the JDK, then you get 2.1.4 which generated code 
slightly differently.   

Double check the version of JAXB you are using.   v2.1-b02-fcs  doesn't look 
like a recent version.   In anycase, this isn't a CXF issue but a JAXB issue.

Dan


On Wednesday 04 August 2010 9:09:03 am Trankh wrote:
> Hi, I have tried to generate java classes with two different ways:
> 
> - from a schema xsd with JAXB2.1 and run XJC and generate java classes.
> - from a wsdl file (with a schema import) and i generate java classes with
> wsdl2java command using CXF.
> 
> 
> The problem is about a java class where there is a difference: The
> difference is the content attribute and its getter and setter which is
> missing with the wsdl2java command method whereas with the jaxb method it
> is present.
> 
> //
> // This file was generated by the JavaTM Architecture for XML Binding(JAXB)
> Reference Implementation, v2.1-b02-fcs
> // See  http://java.sun.com/xml/jaxb http://java.sun.com/xml/jaxb
> // Any modifications to this file will be lost upon recompilation of the
> source schema.
> //
> 
> 
> import javax.xml.bind.annotation.XmlAccessType;
> import javax.xml.bind.annotation.XmlAccessorType;
> import javax.xml.bind.annotation.XmlAttribute;
> import javax.xml.bind.annotation.XmlSeeAlso;
> import javax.xml.bind.annotation.XmlType;
> import javax.xml.bind.annotation.XmlValue;
> 
> 
> 
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "BIN", **propOrder = {
>     "content"**
> })
> @XmlSeeAlso({
>     ED.class
> })
> public abstract class BIN {
> 
>     *...@xmlvalue
>     protected String content;**
>     @XmlAttribute
>     protected BinaryDataEncoding representation;
> 
>     /**
> 
> 
>     public String getContent() {
>         return content;
>     }
> 
>     /**
>      *
>      *             Binary data is a raw block of bits. Binary data is a
>      *             protected type that MUST not be used outside the data
>      *             type specification.
>      *
>      *
>      * @param value
>      *     allowed object is
>      *     {...@link String }
>      *
>      */
>     **public void setContent(String value) {
>         this.content = value;
>     }**
> 
>     /**
>      * Gets the value of the representation property.
>      *
>      * @return
>      *     possible object is
>      *     {...@link BinaryDataEncoding }
>      *
>      */
>     public BinaryDataEncoding getRepresentation() {
>         if (representation == null) {
>             return BinaryDataEncoding.TXT;
>         } else {
>             return representation;
>         }
>     }
> 
>     /**
>      * Sets the value of the representation property.
>      *
>      * @param value
>      *     allowed object is
>      *     {...@link BinaryDataEncoding }
>      *
>      */
>     public void setRepresentation(BinaryDataEncoding value) {
>         this.representation = value;
>     }
> 
> }
> 
> 
> I need this attribute into this class with wsdl2java method.
> 
> 
> This is my wsdl2java command:
> 
> call wsdl2java -Debug -verbose -exsh true  -autoNameResolution -p
> %PACKAGE_BASE%.pa -p "urn:hl7-org:v3"=%PACKAGE_BASE%.patient.hl -d
> %PROJECT_HOME%\src\main\java\  %WSDL_HOME%\Test.wsdl
> 
> 
> thank you very much

-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog

Reply via email to