Additional Parameters Overview Oracle Fusion Middleware Online Documentation Library

18-18 Publishing Reports to the Web with Oracle Reports Services 19 Using the Oracle Reports Web Service 19-1 19 Using the Oracle Reports Web Service A Web service is an application that is built on standard Internet and XML technologies and has the following characteristics : ■ Includes public interfaces and bindings defined and described using XML. ■ Publishes these public interfaces and bindings across the network for use by other programs. A Web service accepts a request, performs its function based on the request, and returns a response. The request and the response can be part of the same operation, or they can occur separately, in which case the consumer need not wait for a response. Both the request and the response usually take the form of XML, a portable data-interchange format, and are delivered over a wire protocol, such as HTTP. Web service transactions are usually conducted between businesses. A business that is a provider of one service can also be a consumer of another service. A Web service consumer can also be a client device, such as a thin client connecting to the Web service provider over a lightweight protocol. This chapter discusses the Oracle Reports Web service and contains the following sections: ■ Overview ■ Getting Started ■ Oracle Reports Web Service Operations ■ Using RWWebServiceUtil to Test RWWebService

19.1 Overview

Oracle Reports provides several ways of submitting a job request to the server-infrastructure for processing: ■ rwservlet rwservlet translates and delivers a job request between HTTP and the Reports Server, such as when submitting from a Web browser or through the event-driven publishing API. ■ rwclient rwclient parses and transfers a command line to run a a report on a remote Reports Server. ■ Oracle Forms 19-2 Publishing Reports to the Web with Oracle Reports Services Oracle Forms is a rapid application development RAD tool, used to build highly scalable Internet database applications. Integrating the Oracle Reports technology into custom applications, especially Java applications, requires the implementation of the mechanisms used by rwservlet, rwcgi, rwclient, and Oracle Forms to submit jobs to the server from within those applications. The RWWebService servlet provides the necessary public interfaces and bindings, and is required to be exposed and to function as a Web service. This functionality enables any application developer to include Oracle Reports in their application.

19.2 Getting Started

This section outlines the steps necessary for: ■ Invoking the RWWebService Servlet ■ Viewing the WSDL

19.2.1 Invoking the RWWebService Servlet

To invoke the RWWebService servlet:

1. Start a Oracle WebLogic Server instance, where the Oracle Reports instance

resides.

2. Enter the following URL in the address field of your browser:

http:yourwebserver:portreportsrwwebservice This takes you to the RWWebService endpoint. The RWWebService endpoint page enables you to do the following:

a. View the Oracle Reports Web service WSDL.

b. Run any RWWebService command using a Web based UI.

19.2.2 Viewing the WSDL

The Web Service Description Language WSDL is an XML format for describing available services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint.

1. Click the WSDL link on the RWWebService Web page to view the Oracle Reports

Web services WSDL document. 2. The last entry in the WSDL is the service description and contains the location of the WebService: soap:address location=http:yourwebserver:8888reportsrwwebservice Note: Oracle Reports Web service does not support dynamic discovery of the WSDL by publishing to the Universal Description, Discovery, and Integration UDDI server. Note: Use Internet Explorer to view the WSDL XML output. Using the Oracle Reports Web Service 19-3 Figure 19–1 Viewing the WSDL Ensure that the URL and port number defined, http:yourwebserver:portreportsrwwebservice, is correct. Oracle Reports WSDL ?xml version=1.0 encoding=UTF-8? -- Published by JAX-WS RI at http:jax-ws.dev.java.net. RIs version is Oracle JAX-WS 2.1.4. -- -- Generated by JAX-WS RI at http:jax-ws.dev.java.net. RIs version is Oracle JAX-WS 2.1.4. -- definitions xmlns:soap=http:schemas.xmlsoap.orgwsdlsoap xmlns:tns=http:oracle.reportsrwclient xmlns:xsd=http:www.w3.org2001XMLSchema xmlns=http:schemas.xmlsoap.orgwsdl targetNamespace=http:oracle.reportsrwclient name=RWWebService types xsd:schema xsd:import namespace=http:oracle.reportsrwclient schemaLocation=http:localhost:8888reportsrwwebservice?xsd=1 xsd:schema types message name=getServerInfo part name=parameters element=tns:getServerInfo message message name=getServerInfoResponse part name=parameters element=tns:getServerInfoResponse message message name=getJobInfo part name=parameters element=tns:getJobInfo message message name=getJobInfoResponse part name=parameters element=tns:getJobInfoResponse message message name=getAPIVersion part name=parameters element=tns:getAPIVersion message message name=getAPIVersionResponse part name=parameters element=tns:getAPIVersionResponse message message name=killJob part name=parameters element=tns:killJob message message name=killJobResponse part name=parameters element=tns:killJobResponse message Note: The hostname specified should be the hostname where the Oracle WebLogic Server instance is running and not where the Reports Server is running. 19-4 Publishing Reports to the Web with Oracle Reports Services message name=runJob part name=parameters element=tns:runJob message message name=runJobResponse part name=parameters element=tns:runJobResponse message portType name=RWWebService operation name=getServerInfo input message=tns:getServerInfo output message=tns:getServerInfoResponse operation operation name=getJobInfo input message=tns:getJobInfo output message=tns:getJobInfoResponse operation operation name=getAPIVersion input message=tns:getAPIVersion output message=tns:getAPIVersionResponse operation operation name=killJob input message=tns:killJob output message=tns:killJobResponse operation operation name=runJob input message=tns:runJob output message=tns:runJobResponse operation portType binding name=RWWebServicePortBinding type=tns:RWWebService soap:binding transport=http:schemas.xmlsoap.orgsoaphttp style=document operation name=getServerInfo soap:operation soapAction= input soap:body use=literal input output soap:body use=literal output operation operation name=getJobInfo soap:operation soapAction= input soap:body use=literal input output soap:body use=literal output operation operation name=getAPIVersion soap:operation soapAction= input soap:body use=literal input output soap:body use=literal output operation operation name=killJob soap:operation soapAction= input Using the Oracle Reports Web Service 19-5 soap:body use=literal input output soap:body use=literal output operation operation name=runJob soap:operation soapAction= input soap:body use=literal input output soap:body use=literal output operation binding service name=RWWebService port name=RWWebServicePort binding=tns:RWWebServicePortBinding soap:address location=http:localhost:8888reportsrwwebservice port service definitions

19.3 Oracle Reports Web Service Operations

Oracle Reports exposes the RWWebService servlet as a Web service with its public interfaces and bindings defined and described using XML. These public interfaces and bindings are published across the network through the WSDL.

19.3.1 Using Oracle Enterprise Manager to Test RWWebService

To test the RWWebservice through Oracle Enterprise Manager, complete the following steps: 1. Log in to Oracle Enterprise Manager. 2. Navigate to your WebLogic Domain.

3. From the WebLogic Domain menu, select Web Services Test Web Service

The Test Web Service page is displayed. 4. Enter the URL of a WSDL and click Parse WSDL. 5. Select the webservice operation that you want to invoke. 6. Enter valid values in appropriate fields.

7. Click Test Web Service.

The Webservice Response is displayed.

8. In case you want to edit the values, click the Request tab and complete the step 6

and 7. The operations supported by the RWWebService endpoint are: ■ getAPIVersion ■ getServerInfo ■ getJobInfo ■ killJob 19-6 Publishing Reports to the Web with Oracle Reports Services ■ runJob

19.3.1.1 getAPIVersion

The getAPIVersion operation returns the version details of the Reports Server in XML format. This operation takes no parameters. To view the getAPIVersion response:

1. Navigate to the Test Web Service page in Oracle Enterprise Manager. See steps 1-3

in Section 19.3.1, Using Oracle Enterprise Manager to Test RWWebService .

2. From the Operation drop-down list, select getAPIVersion.

The Test page does not display any parameters.

3. Click Test Web Service.

The SOAP response is displayed in the Response tab. The following is a sample response of a getAPIVersion operation: ?xml version=1.0 encoding=UTF-8 ? SOAP-ENV:Envelope xmlns:SOAP-ENV=http:schemas.xmlsoap.orgsoapenvelope xmlns:xsi=http:www.w3.org2001XMLSchema-instance xmlns:xsd=http:www.w3.org2001XMLSchema SOAP-ENV:Body ns1:getAPIVersionResponse xmlns:ns1=http:oracle.reports.rwclientRWWebService.wsdl SOAP-ENV:encodingStyle=http:schemas.xmlsoap.orgsoapencoding return xsi:type=xsd:string11.1.1.1.0return ns1:getAPIVersionResponse SOAP-ENV:Body SOAP-ENV:Envelope

19.3.1.2 getServerInfo

The getServerInfoString serverName, String authId operation takes two parameters and returns the Reports Server information in an XML format. The valid parameters are : ■ serverName: A valid non-null server name. This operation returns an error if the specified server is not running in the network. ■ authId: A string in the form of usernamepassword, must be specified for a secured server. This parameter is ignored for a non-secure server. To view the getServerInfo response:

1. Navigate to the Test Web Service page in Oracle Enterprise Manager. See steps 1-3

in Section 19.3.1, Using Oracle Enterprise Manager to Test RWWebService .

2. From the Operation drop-down list, select getServerInfo.

The Test page displays the relevant parameter fields in the Input Arguments section. Note: getAPIVersion is the only operation that returns the entire SOAP response along with the result in a string. The other operations, for example, runJob return the response as an XML block embedded within the SOAP response.