Solved! Go to Solution.
SuccessGetLead result = port.getLead(request, header);
JAXBContext context = JAXBContext.newInstance(SuccessGetLead.class);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
m.marshal(result, System.out);
// Add null checks as appropriate
List<LeadRecord> leadRecordList = result.getResult().getLeadRecordList().getValue().getLeadRecords();
for(int x=0; x < leadRecordList.size(); x++) {
LeadRecord lr = leadRecordList.get(x);
System.out.println("Email: " + lr.getEmail().getValue());
}
SuccessGetLead result = port.getLead(request, header);
JAXBContext context = JAXBContext.newInstance(SuccessGetLead.class);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
m.marshal(result, System.out);
// Add null checks as appropriate
List<LeadRecord> leadRecordList = result.getResult().getLeadRecordList().getValue().getLeadRecords();
for(int x=0; x < leadRecordList.size(); x++) {
LeadRecord lr = leadRecordList.get(x);
System.out.println("Email: " + lr.getEmail().getValue());
}