My Wrapper class is this:
@XmlRootElement(name = "GETA")
public class EfGetAResponseWrapperXmlObject {
private String something;
@XmlElement(name = "result")
public String getSomething() {
return something;
}
public void setSomething(String something) {
this.something = something;
}
}
For this wrapper class I get this answer on SoapUI:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:ef_getAresponse xmlns:ns2="http://service.package/">
<ef_get_AReturn><GETA>
<result>mystring</result>
</GETA></ef_get_AReturn>
</ns2:ef_get_AResponse>
</S:Body>
</S:Envelope>
If I introduce one more variable to my Wrapper class:
@XmlRootElement(name = "GETA")
public class EfGetAResponseWrapperXmlObject {
private String something;
private String other;
@XmlElement(name = "result")
public String getSomething() {
return something;
}
public void setSomething(String something) {
this.something = something;
}
public String getOther() {
return other;
}
public void setOther(String other) {
this.other = other;
}
}
I get this answer:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:ef_getAresponse xmlns:ns2="http://service.package/">
<ef_get_AReturn><![CDATA[<GETA>
<result>fasf</result>
<other>fds</other>
</GETA>]]></ef_get_AReturn>
</ns2:ef_getAresponse>
</S:Body>
</S:Envelope>
I dont understand this behaviour. I want to have the same answer on the first case that I have on second case. How can I do this?
@XmlTransient
as in https://mcmap.net/q/349548/-excluding-fields-in-jaxb – Reprobative