01.02.2013 Views

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Installing and Using <strong>the</strong> Sample Proxy and Java Client<br />

* <strong>the</strong> webservice is usually an XML object which is printed as-is <strong>to</strong> <strong>the</strong><br />

* Standdard output stream. Java based <strong>Reports</strong> Clients making use of this<br />

* <strong>Web</strong>Service class might need <strong>to</strong> parse <strong>the</strong> XML <strong>to</strong> extract meaningful<br />

* information.<br />

*<br />

*/<br />

public class RW<strong>Web</strong>ServiceTest<br />

{<br />

public static void main(String[] args)<br />

{<br />

String serverName = "repserv"; //Name of <strong>the</strong> <strong>Reports</strong> Server<br />

String authid = "portal/welcome1"; //authid, should be null if<br />

//server is not secured.<br />

String cmdline = "server=repserv report=test.rdf "+<br />

"destype=file desname=output.pdf desformat=pdf "+<br />

"userid=scott/tiger@orcl";<br />

try<br />

{<br />

RW<strong>Web</strong>ServiceProxy proxy = new RW<strong>Web</strong>ServiceProxy();<br />

/**<br />

* The following piece of code invokes proxy class' getAPIVersion()<br />

* <strong>to</strong> get <strong>the</strong> <strong>Reports</strong> Server version information.<br />

*/<br />

System.out.println("Get <strong>Reports</strong> Server Version:");<br />

System.out.println("RESULT:"+proxy.getAPIVersion());<br />

/**<br />

* Get <strong>the</strong> <strong>Reports</strong> Server Information in XML format. This will contain<br />

* some server runtime as well as configuration information.<br />

*/<br />

System.out.println("Get Server Info:");<br />

System.out.println("RESULT:\n"+proxy.getServerInfo(serverName, authid));<br />

/**<br />

* Get information about a particular job (<strong>the</strong> job ID needs <strong>to</strong> be<br />

* specified.<br />

*/<br />

System.out.println("Get JobInfo for Job Id=3:");;<br />

System.out.println("RESULT:\n"+proxy.getJobInfo(new Integer(3), serverName,<br />

authid));<br />

/**<br />

* Kill a job with a given job ID.<br />

*/<br />

System.out.println("Kill job with Job Id=3:");<br />

System.out.println("RESULT:\n"+proxy.killJob(new Integer(3), serverName,<br />

authid));<br />

/**<br />

* Submit a job <strong>to</strong> <strong>the</strong> server. The command string takes <strong>the</strong> same form<br />

* as <strong>the</strong> one used for rwclient or any o<strong>the</strong>r <strong>Oracle</strong> <strong>Reports</strong> client.<br />

* You can specify whe<strong>the</strong>r <strong>to</strong> run <strong>the</strong> job synchronously or not. The<br />

* returned string is in XML format indicating <strong>the</strong> job status. Please<br />

* note that with <strong>Oracle</strong> <strong>Reports</strong> version 10g (9.0.4), you can not get <strong>the</strong><br />

* job output.<br />

*/<br />

14-10 <strong>Oracle</strong> Application Server <strong>Reports</strong> Services <strong>Publishing</strong> <strong>Reports</strong> <strong>to</strong> <strong>the</strong> <strong>Web</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!