Accessing Fusion Data From BI Reports Using Java
Accessing Fusion Data From BI Reports Using Java
PAAS 4 SAAS
Introduction
In a recent article by Richard Williams on A-Team Chronicles, Richard explained how you can execute
a BI publisher report from a SOAP Service and retrieve the report, as XML, as part of the response of
the SOAP call. This blog article serves as a follow on blog article providing a tutorial style walk
through on how to implement the above procedure in Java.
This article assumes you have already followed the steps in Richard's blog article and created your
report in BI Publisher, exposed it as a SOAP Service and tested this using SOAPUI, or another SOAP
testing tool.
Following Richards guidance we know that he correct SOAP call could look like this
<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:reportAbsolutePath>/[email protected]/Bi
report.xdo</pub:reportAbsolutePath>
<pub:reportRawData xsi:nil="true" >true</pub:reportRawData>
<pub:sizeOfDataChunkDownload>-1</pub:sizeOfDataChunkDownload>
<pub:flattenXML>true</pub:flattenXML>
<pub:byPassCache>true</pub:byPassCache>
</pub:reportRequest>
<pub:appParams/>
</pub:runReport>
</soap:Body>
</soap:Envelope>
https://blogs.oracle.com/angelo/accessing-fusion-data-from-bi-reports-using-java 1/8
3/3/2020 Accessing Fusion Data from BI Reports using Java | Oracle Angelo Santagata's Blog
Tip :One easy way to determine the reports location is to run the report and then examine the URL in the browser.
. 1. With the BISOAPService project selected, start the JDeveloper SOAP Proxy wizard.
File-> New-> Business Tier-> Web Services-> Web Service Proxy
.
.
. 2. Click Next
. 3. Skipping the first welcome screen, in step 2 enter the JAX-WS Style as the type of SOAP Proxy
you wish to generate in step 3 enter the WSDL of your Fusion Application BI Publisher
webservice WSDL. It’s best to check this URL returns a WSDL document in your web browser
before entering it here. The WSDL location will normally be something like : http://<your fusion
Applications Server>/xmlpserver/services/ExternalReportWSSService?wsdl
https://blogs.oracle.com/angelo/accessing-fusion-data-from-bi-reports-using-java 2/8
3/3/2020 Accessing Fusion Data from BI Reports using Java | Oracle Angelo Santagata's Blog
.
. It's recommended that you leave the copy WSDL into project check-box selected.
. 4. Give a package name, unless you need to it's recommended to leave the Root Package for
generated types to be left blank
.
. 5. Now hit Finish
. 1. With the FusionReportsIntegration project selected, right-mouse click on the project and select
“Project properties”
. 2. In the properties panel select Dependencies
https://blogs.oracle.com/angelo/accessing-fusion-data-from-bi-reports-using-java 3/8
3/3/2020 Accessing Fusion Data from BI Reports using Java | Oracle Angelo Santagata's Blog
. 3. Select the little pencil icon and in the resulting dialog select “Build Output”. This selection tells
JDeveloper that “this project depends on the successful build output” of the other project.
. 4. Save the Dialog
. 1. With the Fusion Reports Integration selected , right mouse Click -> New -> Java -> Java Class
. 1.
ExternalReportWSSService_Service externalReportWSSService_Service;
2.
// Initialise the SOAP Proxy generated by JDeveloper based on the following WSDL
xmlpserver/services/ExternalReportWSSService?wsdl
3.
https://blogs.oracle.com/angelo/accessing-fusion-data-from-bi-reports-using-java 4/8
3/3/2020 Accessing Fusion Data from BI Reports using Java | Oracle Angelo Santagata's Blog
externalReportWSSService_Service = new ExternalReportWSSService_Service();
4.
{ "oracle/wss_username_token_over_ssl_client_policy" });
7.
ExternalReportWSSService externalReportWSSService =
externalReportWSSService_Service.getExternalReportWSSService(securityFeatures);
9.
//Map to appropriate Fusion user ID, no need to provide password with SAML authentication
14.
requestContext.put(WSBindingProvider.USERNAME_PROPERTY, "username");
15.
requestContext.put(WSBindingProvider.PASSWORD_PROPERTY, "password");
16.
requestContext.put(WSBindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"https://yourERPServer:443/xmlpserver/services/ExternalReportWSSService");
17.
reportRequest.setReportAbsolutePath("/[email protected]/Bi report.xdo");
22.
reportRequest.setReportRawData("");
24.
reportRequest.setSizeOfDataChunkDownload(-1);
26.
reportRequest.setFlattenXML(true);
28.
reportRequest.setByPassCache(true);
30.
https://blogs.oracle.com/angelo/accessing-fusion-data-from-bi-reports-using-java 5/8
3/3/2020 Accessing Fusion Data from BI Reports using Java | Oracle Angelo Santagata's Blog
// Run the report
31.
// Display the output, note the response is an array of bytes, you can convert this to a
String
33.
// or you can use a DocumentBuilder to put the values into a XLM Document object for further
processing
34.
System.out.println("Content Type="+reportResponse.getReportContentType());
35.
System.out.println("Data ");
36.
System.out.println("-------------------------------");
37.
System.out.println(data);
39.
System.out.println("-------------------------------");
https://blogs.oracle.com/angelo/accessing-fusion-data-from-bi-reports-using-java 6/8
3/3/2020 Accessing Fusion Data from BI Reports using Java | Oracle Angelo Santagata's Blog
Because we are running this code from the command line as a java client code we need to import
the Fusion Apps Certificate into the Java Key Store. If you run the code from within JDeveloper then
the java keystore is stored in <JDeveloperHome>\wlserver_10.3\server\lib\DemoTrust.jks
Importing certificates
. 1. Download the Fusion Applications SSL certificate, using a browser like internet explorer
navigate to the SOAP WSDL URL
. 2. Mouse click on the security Icon which will bring you to the certificate details
. 3. View Certificate
4. Export Certificate as a CER File
. 5. From the command line we now need to import the certificate into our DemoTrust.jks file using
the following commandkeytool -import -alias fusionKey -file fusioncert.cer -keystore
DemoIdentity.jks
Comments ( 7 )
Recent Content
https://blogs.oracle.com/angelo/accessing-fusion-data-from-bi-reports-using-java 7/8
3/3/2020 Accessing Fusion Data from BI Reports using Java | Oracle Angelo Santagata's Blog
Introduction JET is Oracle's new Are you doing SaaS, or Hey all, I'm going
mobile toolkit specifically written for EBS, integrations and using Oracle the Oracle PaaS
developers to help them build client Integration Cloud Service (ICS)? Do Forum 2017 in Sp
slide applications... you need some inspiration? Well this year in March on
is your...
Site Map Legal Notices Terms of Use Privacy Cookie Preferences Ad Choices Oracle Content Marketing Login
https://blogs.oracle.com/angelo/accessing-fusion-data-from-bi-reports-using-java 8/8