Soap is a new technology for me. I get a Soap message request, this is a part of it
<patient>
<dateOfBirth>
<year></year>
<month></month>
<day></day>
</dateOfBirth>
<firstName>Ivan</firstName>
<lastName>Luku</lastName>
</patient>
This is xsd schema for this part.
xs:complexType name="personVO">
<xs:complexContent>
<xs:extension base="tns:tenantableVO">
<xs:sequence>
<xs:element name="dateOfBirth" type="tns:localDateVO"/>
<xs:element name="firstName" type="xs:string"/>
<xs:element name="lastName" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
------------------------------------------
<xs:complexType name="localDateVO">
<xs:sequence>
<xs:element name="day" type="xs:int" nillable="true" minOccurs="0"/>
<xs:element name="month" type="xs:int" nillable="true" minOccurs="0"/>
<xs:element name="year" type="xs:int" nillable="true" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
As you can see year, day, month in the dateOfBirth tag have empty value. This variable presented in java code like Integer type. What should I do to get null for this variable after got this request?
I tried to write annotation above the get methods, but it didn't work. When I wrote annotation @XmlAttribute it gives me null always whether there are values or not.
@XmlAttribute
public Integer getDay() {
return day;
}
@XmlAttribute
public Integer getMonth() {
return month;
}
@XmlAttribute
public Integer getYear() {
return year;
}
And I tried to do the same annotation for field, but it's give me error like this (Class has two properties of the same name)