We have likely encountered a scenario where a report call fails because it exceeds the online viewing timeout or the maximum allowed file size limit for online rendering. In these situations, the standard runReport method from the ExternalReportWSSService simply isn't enough, the call will time out, leaving us with an error instead of data.
To handle these high-volume requirements, we need to shift from synchronous execution to an asynchronous scheduling model.
In this post, we will do a deep dive into how to use the ScheduleReportWSSService to programmatically schedule a report, manage its execution, and successfully fetch the output once it's ready.
Comparison: Synchronous vs Asynchronous Report calls
We can retrieve the child instance using two primary operations. Both require the Parent Job ID as an input:
getAllJobInstanceIDs: We pass thesubmittedJobId(Parent ID) in the request to receive a list of associated instance IDs.getAllScheduledReportHistoryInfo: We pass both thejobid(Parent ID) and theowner(user ID)to get detailed history, including the child ID.
In the following example, we will focus on getAllJobInstanceIDs
Submit report Get Parent Job ID.
Wait ~15-20 seconds (to allow BIP to spawn the instance) or add retry.
Call
getAllJobInstanceIDsusing the Parent ID.Extract the Child Job ID from the response.
Monitor the Child Job ID for completion.
Request Payload:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:sch="http://xmlns.oracle.com/oxp/service/ScheduleReportService">
<soap:Header/>
<soap:Body>
<sch:getAllJobInstanceIDs>
<submittedJobId>534382</submittedJobId>
</sch:getAllJobInstanceIDs>
</soap:Body>
</soap:Envelope>
Response:
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header/>
<env:Body>
<ns0:getAllJobInstanceIDsResponse xmlns:ns0="http://xmlns.oracle.com/oxp/service/ScheduleReportService">
<ns3:getAllJobInstanceIDs xmlns:ns3="http://xmlns.oracle.com/oxp/service/ScheduleReportService">534383</ns3:getAllJobInstanceIDs>
</ns0:getAllJobInstanceIDsResponse>
</env:Body>
</env:Envelope>