Calling a Rest Webservice using the Spring Rest Template as follows-
ResponseEntity<String> response = restTemplate.exchange(builder.build().encode().toUri(), HttpMethod.GET, entity, String.class);
and get the output in String format as
<Info xmlns="http://schemas.test.org/2009/09/Tests.new" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<FirstName>FirstName</FirstName>
<LastName>LastName</LastName>
<TestGuid>Guid</TestGuid>
<TestUID>1</TestUID>
<Token>token</Token>
<TestUserID>14</TestUserID>
</Info>
When trying to unmarshal it to java class as follows
ResponseEntity<Info> response = restTemplate.exchange(builder.build().encode().toUri(), HttpMethod.GET, entity, Info.class)
The Info class is defined as
@XmlRootElement(name = "Info", namespace = "http://schemas.test.org/2009/09/Tests.new")
public class Info implements Serializable{
private String firstName;
private String lastName;
private String testGuid;
private String testUID;
private String token;
private String testUserID;
//getters and setter
}
get all values of the info class null like Firstname=null..
Could anyone tell what is missing? Thanks