I'm trying to return an xml response with JAXB and the implementation looks like in the example bellow. My question is: There is a way to return the whole xml without setting a value on the field?
@ResponsePayload
public JAXBElement<Ns2AnfrageBonitaetsauskunftAntwortType> getResponse(@RequestPayload JAXBElement<Ns2AnfrageBonitaetsauskunftTyp> request) {
Ns2AnfrageBonitaetsauskunftAntwortType response = new Ns2AnfrageBonitaetsauskunftAntwortType();
response.setSchufaReferenz("test2");
response.setTeilnehmerreferenz("test1");
response.setAktionsdaten("test3");
Ns3BonitaetsauskunftType bonita = new Ns3BonitaetsauskunftType();
bonita.setTeilnehmerkennung("test4");
Ns3VerarbeitungsinformationType verar = new Ns3VerarbeitungsinformationType();
verar.setErgebnistyp("test7");
bonita.setVerarbeitungsinformation(verar);
Ns3VerbraucherdatenAuskunftType daten = new Ns3VerbraucherdatenAuskunftType();
daten.setPersonOhneGeburtsdatum("test6");
bonita.setVerbraucherdaten(daten);
response.setReaktion(bonita);
ObjectFactory objectFactory = new ObjectFactory();
return objectFactory.createBonitaetsauskunft(response);
}
At the moment the response look like this:
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header/>
<env:Body>
<ns3:Bonitaetsauskunft xmlns:ns3="http://ifd-schema.de/BonitaetsauskunftSCHUFA">
<SchufaReferenz>test2</SchufaReferenz>
<Teilnehmerreferenz>test1</Teilnehmerreferenz>
<Aktionsdaten xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">test3</Aktionsdaten>
<Reaktion>
<Teilnehmerkennung>test4</Teilnehmerkennung>
<Verbraucherdaten>
<PersonOhneGeburtsdatum>test6</PersonOhneGeburtsdatum>
</Verbraucherdaten>
<Verarbeitungsinformation>
<Ergebnistyp>test7</Ergebnistyp>
</Verarbeitungsinformation>
</Reaktion>
</ns3:Bonitaetsauskunft>
</env:Body>
</env:Envelope>
I have a lot of more field on which i don't want to set a value but i want them to be in the response. Any ideas?
Thank you