Unable to create request with 'since' to 'until'

Anonymous
Not applicable

Unable to create request with 'since' to 'until'

I am trying to pull LeadActivity changes (ParamsGetLeadChanges). For some reason, interval is not setting correctly. The results seems to be from the very inception.

DatatypeFactory factory = DatatypeFactory.newInstance();
LastUpdateAtSelector leadSelector = new LastUpdateAtSelector();

GregorianCalendar since = new GregorianCalendar();
since.setTimeInMillis(_oldestCreatedAt.getTimeInMillis());
leadSelector.setOldestUpdatedAt(factory.newXMLGregorianCalendar(since));

GregorianCalendar until = new GregorianCalendar();
until.setTimeInMillis(_latestCreatedAt.getTimeInMillis());
JAXBElement<XMLGregorianCalendar> jaxbOldestCreateAtValue =
           objectFactory.createLastUpdateAtSelectorLatestUpdatedAt(factory.newXMLGregorianCalendar(until));
leadSelector.setLatestUpdatedAt(jaxbOldestCreateAtValue);
getRequest().setLeadSelector(leadSelector);

_oldestCreatedAt and _latestCreatedAt are both set correctly.

I want to retrieve changes from _oldestCreatedAt to _latestCreatedAt.

Please help
Tags (1)
8 REPLIES 8
Anonymous
Not applicable

Re: Unable to create request with 'since' to 'until'

I'd start with the sample Java code at http://developers.marketo.com/documentation/soap/getleadchanges/ and tweak it to meet specific needs.
Anonymous
Not applicable

Re: Unable to create request with 'since' to 'until'

That is exactly where I started. That sample code does not use lead selector, and I need to use it, since I need to retrieve changes for a fixed period of time. Can you pleae help me out - I do not know what is wrong with my code.
Anonymous
Not applicable

Re: Unable to create request with 'since' to 'until'

I solved the issue, but using StreamPosition. LoadSelector is not working with ParamsGetLeadChanges. In the documentation its specified, that it should work. Any comments here?
Anonymous
Not applicable

Re: Unable to create request with 'since' to 'until'

I'm hitting the same issue.  With a LeadSelector using LastUpdatedAt  start and end dates and no StreamPosition/StartPosition the query returns all data for all time (if it returns at all), ignoring the LeadSelector.  This is in contrast to the getMultipleLeads call where the same LeadSelector does work as documented.
Anonymous
Not applicable

Re: Unable to create request with 'since' to 'until'

Peter,
Which version of WSDL are you using?  LeadSelector is only available from v2.2

Raj
Anonymous
Not applicable

Re: Unable to create request with 'since' to 'until'

I'm using 2.2 based off the Java code (https://github.com/Marketo/SOAP-API-Java-Client).
Anonymous
Not applicable

Re: Unable to create request with 'since' to 'until'

Please log a support ticket - we'll investigate
Anonymous
Not applicable

Re: Unable to create request with 'since' to 'until'

Any update on this issue, I am having same problem with v2.2

Bishnu