I am trying to export number of leads in batches, but not able to advance to the next batch.
do {
SuccessGetMultipleLeads result = port.getMultipleLeads(request, header);
rgml = result.getResult();
JAXBContext context = JAXBContext.newInstance(SuccessGetLead.class);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
m.marshal(result, System.out);
streamPosition = rgml.getNewStreamPosition();
System.out.println("----- New Stream Position: " + streamPosition);
QName qName = new QName("newStreamPosition");
JAXBElement<String> jaxbNewStreamPosition = new JAXBElement<String>(qName, String.class, streamPosition);
System.out.println("----- Value: " + jaxbNewStreamPosition.getValue());
// APARENTLY THIS IS NOT WORKING RIGHT HERE
request.setStreamPosition(jaxbNewStreamPosition);
} while (rgml.getReturnCount() > 0);
It keeps getting the same first batch over and over.
Please help!
Kiryl