Bonjour, j'ai essayé de générer des classes java à partir d'un shéma xsd en utilisant jaxb2.1 depuis eclipse.

J'ai fait la même chose mais en partant d'un wsdl qui importe le schéma et en utilisant CXF et la commande wsdl2java.

Bizarrement, les classes générées ne sont pas les mêmes.

A partir du wsdl et CXF, il me manque l'attribut content. On le retrouve bien avec la génération depuis le shéma et JAXB2.1

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
 
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1-b02-fcs 
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// 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;
    }
 
}

J'ai besoin de générer mes classes à partir d'un wsdl et je voudrais avoir l'attribut content généré


Voici ma commande wsdl2java :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
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

Merci.