Bonjour,

Je viens vers vous car je dois récupérer des données via un webservice en Java. CXF s'est chargé de créer les classes correspondant à la wsdl mais cette dernière comporte un type de donnée "any".

Les informations dans "any" sont au format XHTML, je souhaiterai donc savoir comment mapper le Object (correspondant au "any") vers le bon type d'objet correspondant au XHTML.

WSDL:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
<s:complexType name="text-with-layout-type" mixed="true">
<s:sequence>
<s:any minOccurs="0" maxOccurs="unbounded"/>
</s:sequence>
<s:attribute name="L" type="s:string"/>
</s:complexType>
JAXB:
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
 
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "text-with-layout-type", propOrder = {
    "content"
})
public class TextWithLayoutType {
 
    @XmlMixed
    @XmlAnyElement(lax = true)
    protected List<Object> content;
    @XmlAttribute(name = "L")
    protected String l;
 
    /**
     * Gets the value of the content property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the content property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getContent().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Object }
     * {@link String }
     * 
     * 
     */
    public List<Object> getContent() {
        if (content == null) {
            content = new ArrayList<Object>();
        }
        return this.content;
    }
 
    /**
     * Gets the value of the l property.
     * 
     * @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getL() {
        return l;
    }
 
    /**
     * Sets the value of the l property.
     * 
     * @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setL(String value) {
        this.l = value;
    }
 
}
D'avance je vous remercie.