The My Wrapper class is as follows:
@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 shell 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 add another variable to the 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 the 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 do not understand this behavior. I want to get the same answer in the first case as in the second case. How can i do this?
java cdata web-services soapui
Goldbones
source share