こちらのwebサービスは、指定したレポートの結果データと、レポートのメタデータを取得します。レポートの結果は、書式設定されていないそのままの形式になります。この結果は、ReportRowオブジェクトの配列に保存され、このオブジェクトは、各結果ロウ(行)を表します。そのため、各ロウ(行)に対して、結果データの各カラム(列)のデータを含む文字列の配列が存在します。 注意:このデータを、文字列表現から各特定のカラム(列)のデータ型に変換するのは、webサービスクライアント次第です。各カラム(列)のデータ型は、SCHEMA関数で取得することができます。 例えば、以下は2つのカラム(列)を含み、各ユーザーロールに割り当てられたユーザー数を特定するロール集計レポートを示しています。 ユーザーロール | 人数 | System Administrator | 1 | Consumer & Collaborator | 5 | Report Content Writer | 4 |
こちらのwebサービスは、各ユーザーロールのReportRowオブジェクトを返します。各オブジェクトは、2つのデータ文字列を含みます。ひとつはロール名であり、もうひとつはユーザー数を表示します。
リクエスト要素以下の要素は、こちらのリクエストとともに渡されます。 リクエスト要素 | データ型 | 説明 | LoginId | String | Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 | Password | String | 上記アカウントのパスワードです。 | OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 | ReportRequest | String | webサービス関数です。「RESULTSET」に設定します。 | OrgRef | String | クライアント組織内部参照IDです。(オプション設定) | ReportId | Integer | 結果データを参照するレポートのIDです。 |
リクエストの例以下のSOAPの例は、こちらの呼び出しに渡すことのできるパラメーターを示しています。 Code Block |
---|
| <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/">
<soapenv:Header/>
<soapenv:Body>
<web:remoteReportCall>
<arg0>
<loginId>admin@yellowfin.com.au</loginId>
<password>test</password>
<orgId>1</orgId>
<reportRequest>RESULTSET</reportRequest>
<reportId>58511</reportId>
</arg0>
</web:remoteReportCall>
</soapenv:Body>
</soapenv:Envelope> |
応答要素応答には、これらの主要なパラメーターが含まれます。(より詳細な応答パラメーターの一覧は、ReportServiceResponseオブジェクトを参照してください) 応答要素 | データ型 | 説明 | StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。 | Results | ReportRow[] | レポートのデータセットの結果を含むオブジェクトの配列です。 |
応答の例サービスは、今回のSOAPの例に基づき、以下の応答を返します。 Code Block |
---|
| <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:remoteReportCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/">
<return>
<author>System Administrator</author>
<authoringMode>JAVA</authoringMode>
<averageRunTime>0</averageRunTime>
<canDrill>false</canDrill>
<category>Audit Reports</category>
<dashboardEnabled>true</dashboardEnabled>
<dataOutput>COLUMN</dataOutput>
<datasource>Yellowfin Configuration Database</datasource>
<errorCode>0</errorCode>
<formatCode>REPORTANDCHART</formatCode>
<hitCount>4</hitCount>
<lastModifiedDate>2016-04-13</lastModifiedDate>
<lastRunDuration>0</lastRunDuration>
<lastRunStatus>RUN_NOERROR</lastRunStatus>
<messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
<messages>Loaded Report: 58511 Successfully</messages>
<messages>Returning RAW Resultset</messages>
<messages>Request Contains No ReportFilter Records.</messages>
<messages>Report Run Successfully</messages>
<messages>Web Service Request Complete</messages>
<private>false</private>
<reportDescription/>
<reportId>58511</reportId>
<reportName>Role Population</reportName>
<reportTemplate>REPORTANDCHART</reportTemplate>
<reportUUID>00c65743-15f8-4f93-ace1-e3d4d2b956eb</reportUUID>
<reportUsage>7</reportUsage>
<results>
<dataValue>System Administrator</dataValue>
<dataValue>1</dataValue>
</results>
<results>
<dataValue>Consumer & Collaborator</dataValue>
<dataValue>5</dataValue>
</results>
<sessionId>c958af74f677c4b1f575bd728d3b25d0</sessionId>
<statusCode>SUCCESS</statusCode>
<subCategory>User Access</subCategory>
<tags>No tags</tags>
<viewName>NEW VIEW</viewName>
</return>
</ns2:remoteReportCallResponse>
</S:Body>
</S:Envelope> |
手順Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。 Expand |
---|
| 管理ユーザーとしてのログインと、実行するwebサービスの呼び出しの指定を含む、こちらの呼び出しを実行するための基礎的なリクエストです。
Code Block |
---|
| ReportServiceRequest rsr = new ReportServiceRequest();
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(new Integer(1));
rsr.setReportRequest("RESULTSET"); |
結果セットを取得するレポートを指定します。 Code Block |
---|
| rsr.setReportId(60712); |
レポートクライアント参照IDを指定することもできます。 Code Block |
---|
| rsr.setReportClientReferenceId("1"); |
リクエストを構成したら、呼び出しを実行します。
Code Block |
---|
| ReportServiceResponse rs=rsc.remoteReportCall(rsr); |
レポートwebサービスを初期化します。実行方法の詳細は、こちらを参照してください。
|
完成例以下は、こちらの関数の完成例です。こちらを使用するには、以下の手順に従います。 - コードをコピーして、「ws_resultset.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_resultset.jsp」を実行します。
Code Block |
---|
| <%
/* ws_resultset.jsp */
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %>
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
<%@ page import="javax.xml.bind.JAXBContext" %>
<%@ page import="javax.xml.bind.Marshaller" %>
<%@ page import="java.io.StringWriter" %>
<%@ page import="javax.xml.bind.JAXBElement" %>
<%@ page import="javax.xml.namespace.QName" %>
<%
ReportService rsc = new ReportService(); //("localhost", 8080, "admin@yellowfin.com.au", "test", "/services/ReportService");
ReportServiceRequest rsr = new ReportServiceRequest();
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(new Integer(1));
rsr.setReportRequest("RESULTSET");
rsr.setReportId(60712);
rsr.setReportClientReferenceId("1");
ReportServiceResponse rs=rsc.remoteReportCall(rsr);
if ("SUCCESS".equals(rs.getStatusCode())) {
JAXBContext context = JAXBContext.newInstance(ReportServiceResponse.class);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); // To format XML
JAXBElement<ReportServiceResponse> rootElement = new JAXBElement<ReportServiceResponse>(new QName("ReportServiceResponse"), ReportServiceResponse.class, rs);
m.marshal(rootElement,out);
//out.write("Success");
} else {
out.write("Failure");
out.write(" Code: " + rs.getErrorCode());
}
%> |
|