I need to convert a soap response xml to a JAVA object to cater it to another service. SOAP response looks like
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:myResponse xmlns:ns2="http://impl.service.abc.com/">
<return>
<response>
<timestamp>11068446</timestamp>
<txnAmount>1</txnAmount>
<userGuid>11068446</userGuid>
<walletSystemTxnId>123456789</walletSystemTxnId>
</response>
<status>SUCCESSS</status>
<statusCode>SUCCESS</statusCode>
<statusMessage>SUCCESS</statusMessage>
</return>
</ns2:myResponse>
</S:Body>
</S:Envelope>
I tried lots f things to convert read it and convert it to my class instance.
How I am calling the soapservice. I am calling soapService which is using webService template of spring framework. code is
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection soapConnection = soapConnectionFactory.createConnection();
//Send SOAP Message to SOAP Server
SOAPMessage soapResponse = soapConnection.call(createSOAPRequest(soapWithdrawAction), soapEndpointUrl);
when I am trying to print the soapResponse
I am getting, the xml which is posted in the very beginning of the question.
Is there any way to achieve this?