0

I'm making a SOAP call to a web service that returns a paginated response. Zeep is the only Python library I've found that even works for this web service.

When I make the call, it returns the first 100 records (1 page) of results. How do I either call again for the next page (repeat until done), or specify that I want all of the pages?

Matt
  • 775
  • 7
  • 24

1 Answers1

1

Create a dict with the request criteria. Grab the first page of results, parse the request for the total number of pages, and setup a loop.

In the case of Workday:

request_crit = {'Response_Filter' : { 
                'Page' : 1,
                'Count' : number_results,
                'As_Of_Entry_DateTime' : your timestamp,
}}

response = service.get_schools(request_crit)
#process the response
request_crit=['Response_Filter']['Page'] +=
  • I didn't realize that the endpoint should be expected to provide paging parameters in the URL. For some reason, I expected it to be handled some other way. Thanks! – Matt Jun 15 '18 at 13:28
  • It's worth noting that if you specify "Page" you must also specify "As_Of_Entry_DateTime" (though this parameter can be left blank to default to the current time). – Matt Mar 22 '19 at 13:39
  • You want to use the same timestamp for each page, otherwise you may get inconsistent results because the request will use a slightly different as_of_entry_datetime for each page. – Alex Mitchell Mar 24 '19 at 01:02