问题
Target: Supply XML data for BI Publisher
report within SOAP request to it's RunReport()
method.
Environment:
Oracle BI Publisher 11.1.1.7.0 (build:20130303.1415)
Client - SoapUI 5.0.0.0 or custom PL/SQL code (Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production) callling service with use of http_util which works fine with other reports on the same BI Publisher server by passing parameters through parameterNameValues
node.
Research:
After spending many hours I found only this topic on OTN(requires registration) which explains by the way how to use reportRawData parameter. I tried to use this recommendations but with no success.
Question:
Is it possible to supply XML data directly in SOAP request while calling RunReport()
without uploading/creating a temporary file and without using JDBC data source?
There are a big probability that I missed something obvious, so please review example setup below and structure of SOAP request.
I already know at least one possible workaround in my situation (e.g. organize temporary JDBC data source to take data from it) but wondering if there are any clear and working way to implement this task.
Example setup:
1. Create example XML data file test_ds_example.xml
:
`<?xml version="1.0" encoding="utf-8"?>`
`<test> <field_val>AAAAA</field_val></test>`
Create data source test_ds
Add
test_ds
XML file dataset and supplytest_ds_example.xml
as local file:Test data and save it as sample:
Create report based on
test_ds
:Create a basic template with phrase "Field Val:" and field filled from
/test/field_val
Test report in BI Publisher GUI and got text "Field Val: AAAAA"
Make SOAP request with field value changed to
B-B-B-B-B
:
Data:
`<?xml version="1.0" encoding="utf-8"?>`
`<test> <field_val>B-B-B-B-B</field_val></test>`
Request with data in reportRawData
node:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService">
<soapenv:Header/>
<soapenv:Body>
<pub:runReport>
<pub:reportRequest>
<pub:attributeFormat>html</pub:attributeFormat>
<pub:attributeTemplate>claimnotification_xml</pub:attributeTemplate>
<pub:byPassCache>True</pub:byPassCache>
<pub:dynamicDataSource>
<pub:fileDataSource>
<pub:dynamicDataSourcePath/>
<pub:temporaryDataSource>True</pub:temporaryDataSource>
</pub:fileDataSource>
</pub:dynamicDataSource>
<pub:parameterNameValues/>
<pub:reportAbsolutePath>/a_test/test_xml_report.xdo</pub:reportAbsolutePath>
<pub:sizeOfDataChunkDownload>-1</pub:sizeOfDataChunkDownload>
</pub:reportRequest>
<pub:saveDataOption>False</pub:saveDataOption>
<pub:reportRawData><?xml version="1.0" encoding="utf-8"?><test> <field_val>B-B-B-B-B</field_val></test></pub:reportRawData>
<pub:userID>weblogic_user</pub:userID>
<pub:password>weblogic_user_password</pub:password>
</pub:runReport>
</soapenv:Body>
</soapenv:Envelope>
- Execute request but it returns "Field Val: AAAAA" instead of expected "Field Val:B-B-B-B-B" :(
回答1:
After lots of experiments I decided to pass same XML data through reportData
tag in base64-encoded form, so final form of SOAP request looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService">
<soapenv:Header/>
<soapenv:Body>
<pub:runReport>
<pub:reportRequest>
<pub:attributeFormat>html</pub:attributeFormat>
<pub:attributeTemplate>claimnotification_xml</pub:attributeTemplate>
<pub:byPassCache>True</pub:byPassCache>
<pub:dynamicDataSource>
<pub:fileDataSource>
<pub:dynamicDataSourcePath/>
<pub:temporaryDataSource>True</pub:temporaryDataSource>
</pub:fileDataSource>
</pub:dynamicDataSource>
<pub:parameterNameValues/>
<pub:reportAbsolutePath>/a_test/test_xml_report.xdo</pub:reportAbsolutePath>
<pub:sizeOfDataChunkDownload>-1</pub:sizeOfDataChunkDownload>
</pub:reportRequest>
<pub:saveDataOption>False</pub:saveDataOption>
<pub:reportData>PD94bWwgdmVyc21vbj0iMS4wIiB1bmNvZG1uZz0iVVRGLTgiPz48dGVzdD48ZmllbGRfdmFsPkItQi1CLUItQjwvZmllbGRfdmFsPjwvdGVzdD4=</pub:reportData>
<pub:userID>weblogic_user</pub:userID>
<pub:password>weblogic_user_password</pub:password>
</pub:runReport>
</soapenv:Body>
</soapenv:Envelope>
This solution did not match exactly with initial target but allows me to avoid external data sources in case of rendering of simple documents.
来源:https://stackoverflow.com/questions/27558070/call-bi-publisher-web-service-with-reportrawdata