Hi, I made the following SOAP call -
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://www.marketo.com/mktows/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="http://www.marketo.com/mktows/">
<env:Header>
<ns1:AuthenticationHeader>
<!--- Removed -->
</ns1:AuthenticationHeader>
</env:Header>
<env:Body>
<ns1:paramsGetMultipleLeads>
<leadSelector xsi:type="ns1:LeadKeySelector">
<keyType>EMAIL</keyType>
<keyValues>
<stringItem>test@test.com</stringItem>
</keyValues>
</leadSelector>
</ns1:paramsGetMultipleLeads>
</env:Body>
</env:Envelope>
This is the response I received -
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://www.marketo.com/mktows/">
<SOAP-ENV:Body>
<ns1:successGetMultipleLeads>
<result>
<returnCount>3</returnCount>
<remainingCount>1</remainingCount>
<newStreamPosition/>
<leadRecordList>
<!-- 3 leadRecords with email = 'test@test.com' -->
</leadRecordList>
</result>
</ns1:successGetMultipleLeads>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
As you can see, the remainingCount is reported to be 1 but the newStreamPosition is empty. The condition I use to terminate the stream is 'remainingCount == 0'. So the empty newStreamPosition leads to an infinite loop.
I've temporarily modified the condition to 'remainingCount == 0 OR newStreamPosition is blank'. What's going on here?