Bonsoir,
J'ai généré mes classes avec xjc depuis une DTD. La classe générée est la suivante :
Quand je lance l'unmarshalling, il me retourne mon objet subscriptionACK avec ses deux valeurs à null. Avez-vous une idée du soucis ?
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99 // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.3-b01-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. // Generated on: 2008.03.06 at 06:06:14 PM CET // package com.estar.bo.insurance.mondial.services.generated; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <choice> * <element name="contractNumber" type="{http://www.mondial-assistance.com/ecommerce/schema/}contractNumberType"/> * <element name="error" type="{http://www.mondial-assistance.com/ecommerce/schema/}errorType"/> * </choice> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "contractNumber", "error" }) @XmlRootElement(name = "subscriptionACK") public class SubscriptionACK { @XmlElement(namespace = "") protected String contractNumber; @XmlElement(namespace = "") protected ErrorType error; /** * Gets the value of the contractNumber property. * * @return * possible object is * {@link String } * */ public String getContractNumber() { return contractNumber; } /** * Sets the value of the contractNumber property. * * @param value * allowed object is * {@link String } * */ public void setContractNumber(String value) { this.contractNumber = value; } /** * Gets the value of the error property. * * @return * possible object is * {@link ErrorType } * */ public ErrorType getError() { return error; } /** * Sets the value of the error property. * * @param value * allowed object is * {@link ErrorType } * */ public void setError(ErrorType value) { this.error = value; } }
Voici un exemple de xml passé au unmarshaller :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <?xml version="1.0" encoding="UTF-8"?> <subscriptionACK xmlns="http://www.mondial-assistance.com/ecommerce/schema/"> <contractNumber>ESTGB0009999104</contractNumber> </subscriptionACK>
Partager