Building UWS Client Applications


The fact that this kind of application-to-application interaction is possible at all demonstrates the flexibility of web services. Web services present a text-file interface over HTTP(s) to any back-end service. As such, you can interact with these services directly through HTTP(s) and XML parsing. From a programming standpoint, however, this direct approach takes plenty of knuckle grease.

You can write the code to build XML documents, request and receive them from the web service, and parse responses into something meaningful, if you like. Or, you can simply use the Business Objects Java or .NET consumer SDK libraries to do the dirty work for you. These SDKs make WSDL conformant requests to the UWS server, which in turn interacts with BusinessObjects Enterprise XI over HTTP or SSL through a Java-based program designed for sending and receiving SOAP requests. Additionally, this SDK supports requests to clustered environments transparently by handling the state internally.

Listing 32.1 uses the Java-consumer SDK to output HTML from reportID=386.

Listing 32.1. Simple UWS Report Viewer

String[] strBORepEngURL = boSession.getAssociatedServicesURL("ReportEngine"); //If no URLs are returned, the service is not available if(strBORepEngURL.length > 0){ ReportEngine boRepEng = ReportEngine.getInstance(boSession,strBORepEngURL[0]); ViewSupport htmlViewSupport = new ViewSupport(); htmlViewSupport.setOutputFormat(OutputFormatType.HTML); htmlViewSupport.setViewType(ViewType.CHARACTER); htmlViewSupport.setViewMode(ViewModeType.REPORT); RetrieveCharacterView retCharView = new RetrieveCharacterView(); retCharView.setViewSupport(htmlViewSupport); RetrieveData retBOData = new RetrieveData(); retBOData.setRetrieveView(retCharView); DocumentInformation docInfo = boRepEng.getDocumentInformation("386",null,null,null,retBOData); docInfo = boRepEng.getDocumentInformation("386",null,null,null,retBOData); CharacterView cv = (CharacterView)docInfo.getView(); out.print(cv.getContent()); }

In the snippet above, notice how output format and view mode are specified. Tables 32.2 and 32.3 show all of the retrieval options possible for Crystal Reports and WebI Documents respectively.

Table 32.2. UWS View Types and View Modes Supported for Crystal Reports

Crystal Reports

XLS

PDF

RTF

XML

HTML

DOCUMENT

Y

Y

Y

REPORT

   

Y[*]

 

REPORT_PAGE

Y

Y

Y

Y


[*] XML can be returned only after patching UWS. A patch is available at www.usingcrystal.com.

Table 32.3. UWS View Types and View Modes Supported for WebIntelligence

Web Intelligence

XLS

PDF

RTF

XML

HTML

DOCUMENT

Y

Y

REPORT

Y

Y

 

Y

Y

REPORT_PAGE

Y

Y


Because Web Intelligence supports retrieval of multiple, incongruous resultsets, WebIntelligence XML documents contain sections per resultset or data provider. With Crystal Reports, XML is returned using the RAS Rowset Controller because XML is not yet a first-class export format through the page server in this release.




Crystal Reports XI(c) Official Guide
Crystal Reports XI Official Guide
ISBN: 0672329174
EAN: 2147483647
Year: N/A
Pages: 365

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net