How to remove the XML declaration in Jaxb2Marshaller response?

Viewed 121

I have generated the java sources using the mvn package using the WSDL.

I am getting the response from the server as below

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<doIFXResponse xmlns="http://www.openuri.org/">
  <doIFXResult>
      <?xml version="1.0" encoding="UTF-8" ?> 
        <IFX>
           <SvcRs>Ravi</SvcRs>
        </IFX>
  </doIFXResult>
 </doIFXResponse>

I want to change the response as below

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<doIFXResponse xmlns="http://www.openuri.org/">
  <doIFXResult>
        <IFX>
           <SvcRs>Ravi</SvcRs>
        </IFX>
  </doIFXResult>
 </doIFXResponse>

My Client as below

SOAPDepInqRs response = (SOAPDepInqRs) getWebServiceTemplate().marshalSendAndReceive(doIfx);

JAXb2Client InqClient = new InqClient();
InqClient.setDefaultUri("http://*****:****/service.jws");
InqClient.setMarshaller(Jaxb2Marshaller);
InqClient.setUnmarshaller(Jaxb2Marshaller);

Is there any way to remove the XML declaration from the response body

0 Answers
Related