Unable to advance to next batch with GetMultipleLeads

Anonymous
Not applicable

Unable to advance to next batch with GetMultipleLeads

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
Tags (1)
1 REPLY 1
Anonymous
Not applicable

Re: Unable to advance to next batch with GetMultipleLeads

I think I found the issue.

QName was incorrect.

Correct version would use this:

 <element name="streamPosition" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>