There are two services for the reports
Public Services: Expect credentials in the payload/body of the SOAP envelope.
- xmlpserver/services/v2/ReportService?wsdl and method is runReport
Protected Services: Expects credentials as part of headers in the SOAP envelope.
- xmlpserver/services/ExternalReportWSSService?wsdl and methods are
- runReport If data size is below 50 MB only this method is enough
- downloadReportDataChunk If the data size is more than 50 MB then this method will be required along with an above method
Let's discuss how to handle if the data size is below 50 MB
Call the Service
https://xxxx.xxxxx.xxxxx.oraclecloud.com:443/xmlpserver/services/ExternalReportWSSService
High-Level Steps
1. Call the above service operation named runReport
2. Pass the following details like
- reportAbsolutePath: It will contain the report path like /custom/first-report.xdo
- sizeOfDataChunkDownload: pass -1 to download all the report data
- parameterNameValues: It will contains child elements name & values of the parameters
- Optionally you may also pass flattenXML either true or false as per requirements and attributeFormat like csv etc.
3. This operation will return reportBytes in base 64 format and will have below fields as well in response
- reportContentType: text/plain;charset=UTF-8
- reportFileID: This field will be null whenever you fetch complete data using sizeOfDataChunkDownload with value -1
- reportLocale
- metaDataList
4. How to validate the encrypted data: You may use https://www.base64decode.org/
Request
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService">
<soap:Header/>
<soap:Body>
<pub:runReport>
<pub:reportRequest>
<pub:attributeFormat>csv</pub:attributeFormat>
<!--format of data live csv-->
<pub:attributeLocale/>
<!--language of report data like English-->
<pub:attributeTemplate>xyz</pub:attributeTemplate>
<!--Template Name-->
<pub:flattenXML>false</pub:flattenXML>
<!--data in xml or not true / false-->
<pub:parameterNameValues>
<!--Report Parameter details like name and its values-->
<!--Zero or more repetitions:-->
<pub:item>
<!--This item will let you configure no of paramters so it will be repeated as many as no of parameters are required-->
<pub:name>Param1</pub:name>
<!--Name of the parameter-->
<pub:values>
<!--Zero or more repetitions:-->
<pub:item/>
<!--Values of the parameter and this may be repeated inorder to pass multiple values if your report supports-->
</pub:values>
</pub:item>
<pub:item>
<!--This item will let you configure no of paramters so it will be repeated as many as no of parameters are required-->
<pub:name>param2</pub:name>
<!--Name of the parameter-->
<pub:values>
<!--Zero or more repetitions:-->
<pub:item/>
<!--Values of the parameter and this may be repeated inorder to pass multiple values if your report supports-->
</pub:values>
</pub:item>
</pub:parameterNameValues>
<pub:reportAbsolutePath>/Custom/First_BI_RPT.xdo</pub:reportAbsolutePath>
<!--This is the absolute path of the report to get the absoulte path go to report and click on scheudle then you will get it-->
<pub:sizeOfDataChunkDownload>-1</pub:sizeOfDataChunkDownload>
<!--it will allow how much data you want to get it if value is -1 then all the data will be fetched but be ensure data size is below 50 MB else you may pass 0 to 9 in case of chunk data-->
<!--If you will get data into chunk then you have to call other operatoin downloadReportDataChunk of the same service ExternalReportWSSService-->
</pub:reportRequest>
</pub:runReport>
</soap:Body>
</soap:Envelope>
Response
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header/>
<env:Body>
<ns2:runReportResponse xmlns:ns2="http://xmlns.oracle.com/oxp/service/PublicReportService">
<ns2:runReportReturn>
<ns2:reportBytes>77u/SkVfQkFUQ0hfSUQsQVBQUk9WRVJfRU1QTE9ZRUVfSUQsTSMSIK</ns2:reportBytes>
<ns2:reportContentType>text/plain;charset=UTF-8</ns2:reportContentType>
<ns2:reportFileID xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<ns2:reportLocale xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<ns2:metaDataList xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</ns2:runReportReturn>
</ns2:runReportResponse>
</env:Body>
</env:Envelope>
To Decode encrypted data use https://www.base64decode.org/
Call the Service
https://xxxx.xxxxx.xxxxx.oraclecloud.com:443/xmlpserver/services/ExternalReportWSSService
High-Level Steps
1. Call the above service operation named runReport
2. Pass the following details like
- reportAbsolutePath: It will contain the report path like /custom/first-report.xdo
- sizeOfDataChunkDownload: pass 1 (1 to 9) to download report data into chunk
- parameterNameValues: It will contains child elements name & values of the parameters
- Optionally you may also pass flattenXML either true or false as per requirements and attributeFormat like csv etc.
3. This operation will return reportBytes in base 64 format and reportFileID will have temporary file like "documents/xmlpXXXX35353.tmp" and will have below fields as well in response
- reportBytes: 7w==
- reportContentType: text/plain;charset=UTF-8
- reportFileID: documents/xmlpXXXX35353.tmp
- reportLocale
- metaDataList
4. Call the operation downloadReportDataChunk of the above service and pass the following details
<pub:downloadReportDataChunk>
<pub:fileID>documents/xmlpwsstXXXX23335.tmp</pub:fileID>
<pub:beginIdx>0</pub:beginIdx>
<pub:size>1000</pub:size>
</pub:downloadReportDataChunk>
6. How to validate the encrypted data: You may use https://www.base64decode.org/
References
No comments:
Post a Comment