Hi everybody, (sorry for my poor english)

I face a problem in the project I am working on, my webservice makes request in a database which can return null. I fill objects properties with these nullable values and return theses objects (Jaxb2Marshaller handling the marshalling part).

My problem is that the null properties aren't marshalled, when my client wanted to see <toto></toto> or <toto/> if the toto properties is null, he can't see the tag <toto> at all.

Example:
My Model:
Code:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AdresseEmailType", propOrder = {
    "adresseEmail"
})
public class AdresseEmailType {
@XmlElement(name = "AdresseEmail")
    protected String adresseEmail;
    @XmlAttribute(name = "Id")
    protected String id;
    @XmlAttribute(name = "Type")
    protected String type;
with the appropriates getters and setters

My code (light version):
Code:
AdresseEmailType email = new AdresseEmailType ();
email.setId("1");
email.setAdresseEmail("toto@springsource.org");
email.setType(null);
return email;
Here is the xml I get with SoapUI:
<AdresseEmailType Id="1">
<AdresseEmail>toto@springsource.org</AdresseEmail>
</AdresseEmailType >

I wanted to have:
<AdresseEmailType Id="1" Type="">
<AdresseEmail>toto@springsource.org</AdresseEmail>
</AdresseEmailType >


The exemple is also true when the property adresseEmail is null, the tag <AdresseEmail> is absent of the response. (In this case I would like to have <AdresseEmail></AdresseEmail> or </AdresseEmail>).


So my problem is that I would like to modify the properties of the Marshaller to set the String "" when I set a null properties. Does somebody have ideas for me? (where can I find the complete source code of the Jaxb2Marshaller, does it exist a property I can modify to replace null by "" for String?)


Thank you guys for any help.

Have a nice day.