Skip to content
Advertisement

Convert Soap XML response to Object

i’m new to working with SOAP API’s

I have a soap response from an API

JavaScript

I’m trying to transform this into an object.

From reading articles online I’m trying to use JAXB to do this, but my object is empty.

Here’s the code for reading the response. I wrote the response to an xml file for test purposes:

JavaScript

The LoginResult class:

JavaScript

Thanks in advance!

Advertisement

Answer

you can use this code to retrieve a POJO, and also add an @XmlRootElement as header to your POJO.

(I did’nt test the code below)

JavaScript

EDIT :

I found a solution for you:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement