Newer Version Available
Sample query and queryMore Calls
The following Java and C# examples show usage of the query() and queryMore() calls for the partner WSDL. Each example sets the batch size of the query to 250 items returned. It then performs a query call to get the first name and last name of all contacts and iterates through the contact records returned. For each contact, it writes the contact’s first name and last name to the output, or only the last name if the first name is null. Finally, if there are more items to be returned by the query, as indicated by a QueryResult.done property value of false, it calls queryMore() to get the next batch of items, and repeats the process until no more records are returned.
To execute the sample method, you can use the corresponding Java or C# template class provided in Examples Using the Partner WSDL.