- Created by Yellowfin Admin on Jul 04, 2018
You are viewing an old version of this page. View the current version.
Compare with Current View Version History
Version 1 Next »
以下は、Yellowfinの構成に使用することのできるwebサービスです。
こちらの関数は、Yellowfinのシステム構成設定を更新します。これは、Yellowfinのデータベース内の構成テーブルの設定詳細を直接変更することで機能しますが、一般的なシステム設定のみ適用することが可能で、カスタム設定には適用できません。Yellowfinは、ConfigTypeCodeカラム(列)の値が「SYSTEM」であることを確認することで、これを判断します。そのため、これは基本的にデフォルト組織に適用されます。
データベーステーブルが更新されたら、これらの変更を反映するためにYellowfinを再起動しなくてはいけません。
リクエストパラメーター
以下の要素は、こちらのリクエストとともに渡されます。
リクエスト要素 | データ型 | 説明 |
LoginId | String | Yellowfin Webサービスに接続する管理者アカウントです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 |
Password | String | 上記アカウントのパスワードです。 |
OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 |
Function | String | Webサービス関数です。こちらは、「SAVECONFIGURATION」に設定します。 |
Parameter | String[] | 文字列の配列です。このパラメーターは構成設定を渡すために使用します。最初の文字列は、configCodeのコンテンツで、二番目は構成テーブルのconfigDataである必要があります。 |
Client | AdministrationClientOrg | 構成を更新する特定のクライアント組織を指定するために使用するオプションパラメーターです。しかし、こちらが指定されない場合、構成設定はデフォルト組織に適用されます。システム構成設定の大部分はグローバルのため、特定のクライアントに設定できないことに留意しておいてください。 |
以下は、新規ユーザーを作成するために、AdministrationClientOrgオブジェクトに設定しなくてはいけない必須パラメーターです。
パラメーター | データ型 | 説明 |
ClientReferenceId | String | クライアントを識別するために使用する固有のIDです。 |
リクエストの例
以下は、こちらのリクエストのSOAP XMLの例です。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/"> <soapenv:Header/> <soapenv:Body> <web:remoteAdministrationCall> <arg0> <loginId>admin@yellowfin.com.au</loginId> <password>test</password> <orgId>1</orgId> <function>SAVECONFIGURATION</function> <parameters>Simple_Authentication</parameters> <parameters>true</parameters> </arg0> </web:remoteAdministrationCall> </soapenv:Body> </soapenv:Envelope>
応答パラメーター
返される応答には、これらのパラメーターが含まれます。
応答要素 | データ型 | 説明 |
StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。
|
応答の例
サービスは、今回のSOAPの例に基づき、以下の応答を返します。
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/"> <return> <errorCode>0</errorCode> <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages> <messages>Web Service Request Complete</messages> <sessionId>15359eb5b3d7d2c63c6f43affe5f3b45</sessionId> <statusCode>SUCCESS</statusCode> </return> </ns2:remoteAdministrationCallResponse> </S:Body> </S:Envelope>
手順
Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
管理ユーザーとしてのログインと、実行するwebサービスの呼び出しの指定を含む、こちらの関数のリクエストを定義します。
AdministrationServiceRequest rsr = new AdministrationServiceRequest(); rsr.setLoginId("admin@yellowfin.com.au"); rsr.setPassword("test"); rsr.setOrgId(1); rsr.setFunction("SAVECONFIGURATION");
パラメーターオブジェクト内で更新する構成設定を渡します。以下のコードの例では、Yellowfinの認証方法を「Simple」に設定しています。
rsr.setParameters(new String[]{"SIMPLE_AUTHENTICATION","TRUE"});
リクエストを構成したら、呼び出しを実行します。
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
管理サービスを初期化します。実行方法の詳細は、こちらを参照してください。
応答を取得するために、以下のコードを追加します。応答には、StatusCodeが含まれます。(より詳細な情報は、上記応答パラメーターの表を参照してください)
if ("SUCCESS".equals(rs.getStatusCode()) ) { out.write("<br>Success"); } else { out.write("<br>Failure"); out.write(" Code: " + rs.getErrorCode()); }
完成例
以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。
- コードをコピーして、「ws_saveconfiguration.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_saveconfiguration.jsp」を実行します。
<% /* ws_SAVECONFIGURATION.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.*" %> <% /* This example sets Yellowfin authentication method to Simple. That means, once Yellowfin has been restarted, the LOGINUSERNOPASSWORD call can be used to log users into Yellowfin with no password provided. */ AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false); // adjust host and port number AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService(); AdministrationServiceRequest rsr = new AdministrationServiceRequest(); rsr.setLoginId("admin@yellowfin.com.au"); // provide your Yellowfin webservices admin account rsr.setPassword("test"); // set to the password of the account above rsr.setOrgId(1); rsr.setFunction("SAVECONFIGURATION"); rsr.setParameters(new String[]{"SIMPLE_AUTHENTICATION","TRUE"}); AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); if ("SUCCESS".equals(rs.getStatusCode()) ) { out.write("<br>Success"); } else { out.write("<br>Failure"); out.write(" Code: " + rs.getErrorCode()); } %>
こちらの関数は、Yellowfin内のカスタム構成設定を更新します。カスタムパラメーターは、クライアント組織に適用することができます。これは、Yellowfinのデータベース内の構成テーブルの詳細を直接変更することで機能します。Yellowfinは、ConfigTypeCodeカラム(列)の値が「CUSTOM」のものを確認することで、変更をする設定を判断します。
データベーステーブルを更新したら、変更内容を反映するためにYellowfinを再起動しなくてはいけません。
リクエストパラメーター
以下の要素は、こちらのリクエストとともに渡されます。
リクエスト要素 | データ型 | 説明 |
LoginId | String | Yellowfin Webサービスに接続する管理者アカウントです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 |
Password | String | 上記アカウントのパスワードです。 |
OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 |
Function | String | Webサービス関数です。こちらは、「SAVECUSTOMPARAMETER」に設定します。 |
Parameters | String[] | 文字列の配列です。最初の文字列をconfigCodeの値に設定し、二番目を構成テーブルのconfigDataカラム(列)の値に設定します。 |
Client | AdministationClientOrg | 構成を更新する特定のクライアント組織を指定するために使用するオプションパラメーターです。しかし、こちらを指定しない場合は、構成設定はデフォルト組織に適用されます。 |
以下は、新規ユーザーを作成するためにAdministrationClientOrgオブジェクトに設定しなくてはいけない必須パラメーターです。
パラメーター | データ型 | 説明 |
ClientReferenceId | String | クライアント組織を識別するために使用する固有のIDです。 |
リクエストの例
以下は、こちらのリクエストのSOAP XMLの例です。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/"> <soapenv:Header/> <soapenv:Body> <web:remoteAdministrationCall> <arg0> <loginId>admin@yellowfin.com.au</loginId> <password>test</password> <orgId>1</orgId> <function>SAVECUSTOMPARAMETER</function> <parameters>Simple_Authentication</parameters> <parameters>true</parameters> </arg0> </web:remoteAdministrationCall> </soapenv:Body> </soapenv:Envelope>
応答パラメーター
返される応答には、これらのパラメーターが含まれます。
応答要素 | データ型 | 説明 |
StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。
|
応答の例
サービスは、今回のSOAPの例に基づき、以下の応答を返します。
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/"> <return> <errorCode>0</errorCode> <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages> <messages>Web Service Request Complete</messages> <sessionId>471080457c1359cbf09c29cd348f97d1</sessionId> <statusCode>SUCCESS</statusCode> </return> </ns2:remoteAdministrationCallResponse> </S:Body> </S:Envelope>
手順
Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
管理ユーザーとしてのログインと、実行するwebサービスの呼び出しの指定を含む、こちらの関数のリクエストを指定します。
AdministrationServiceRequest rsr = new AdministrationServiceRequest(); rsr.setLoginId("admin@yellowfin.com.au"); rsr.setPassword("test"); rsr.setOrgId(1); rsr.setFunction("SAVECUSTOMPARAMETER");
パラメーターオブジェクト内で更新する構成設定を渡します。以下のコードの例では、Yellowfinの認証方法を「Simple」に設定しています。
rsr.setParameters(new String[]{"SIMPLE_AUTHENTICATION","TRUE"});
リクエストを構成したら、呼び出しを実行します。
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
管理サービスを初期化します。実行方法の詳細は、こちらを参照してください。
応答を取得するために、以下のコードを追加します。応答にはStatusCodeが含まれます。(より詳細な情報は、上記応答パラメーターの表を参照してください)
if ("SUCCESS".equals(rs.getStatusCode()) ) { out.write("<br>Success"); } else { out.write("<br>Failure"); out.write(" Code: " + rs.getErrorCode()); }
完成例
以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。
- コードをコピーして、「ws_savecustomparameter.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_savecustomparameter.jsp」を実行します。
<% /* ws_savecustomparameter.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.*" %> <% /* This example set Yellowfin authentication method to Simple. That means, once Yellowfin has been restarted, LOGINUSERNOPASSWORD call can be used to log users into Yellowfin with no password provided. */ AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false); // adjust host and port number AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService(); AdministrationServiceRequest rsr = new AdministrationServiceRequest(); rsr.setLoginId("admin@yellowfin.com.au"); // provide your Yellowfin web services admin account rsr.setPassword("test"); // change to the password of the account above rsr.setOrgId(1); rsr.setFunction("SAVECUSTOMPARAMETER"); rsr.setParameters(new String[]{"SIMPLE_AUTHENTICATION","TRUE"}); AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); if ("SUCCESS".equals(rs.getStatusCode()) ) { out.write("<br>Success"); } else { out.write("<br>Failure"); out.write(" Code: " + rs.getErrorCode()); } %>
こちらのwebサービスは、現在のYellowfinのシステム構成詳細を取得します。これは、ConfigCode要素を指定することで実行されます。システムは、Yellowfinのデータベース内の構成テーブルの要素の該当するconfigDataカラム(列)に保存されている値を取得します。YellowfinはConfigTypeCodeカラム(列)内の「SYSTEM」を含む値を確認するため、(カスタムではなく)システムパラメーターを読み込むことに留意してください。
例えば、これを使用することで、simple認証が有効になっているかどうかを確認し、パスワードなしにユーザーログインをすることができます。
リクエストパラメーター
以下の要素は、こちらのリクエストとともに渡されます。
リクエスト要素 | データ型 | 説明 |
LoginId | String | Yellowfin Webサービスに接続する管理者アカウントです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 |
Password | String | 上記アカウントのパスワードです。 |
OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 |
Function | String | Webサービス関数です。こちらは、「LOADCONFIGRATION」に設定します。 |
Parameter | String[] | 文字列の配列です。これは、ConfigCode要素の値を渡すために使用します。 |
Client | AdministrationClientOrg | 構成を更新する特定のクライアント組織を指定するために使用するオプションパラメーターです。しかし、こちらが指定されない場合は、構成設定はデフォルト組織に適用されます。 |
以下のパラメーターは、新規ユーザーを作成するためにAdministrationClientOrgオブジェクトに設定しなくてはいけない必須パラメーターです。
パラメーター | データ型 | 説明 |
ClientReferenceId | String | クライアント組織を識別するために使用する固有のIDです。 |
応答パラメーター
返される応答には、これらのパラメーターが含まれます。
応答要素 | データ型 | 説明 |
StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。
|
BinaryData | String | (Yellowfinのリポジトリデータベースから)指定したConfiguration.configCode要素のconfigDataの値を含みます。構成テーブル内にConfigCodeが見つからない場合は、Null値が返されます。 |
手順
Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
管理ユーザーとしてのログインと、実行するwebサービスの呼び出しの指定を含む、こちらの関数のリクエストを定義します。
AdministrationServiceRequest rsr = new AdministrationServiceRequest(); rsr.setLoginId("admin@yellowfin.com.au"); rsr.setPassword("test"); rsr.setOrgId(1); rsr.setFunction("LOADCONFIGURATION");
パラメーターオブジェクト内で更新する構成設定を渡します。以下のコードの例では、Yellowfinの認証方法を「Simple」に設定しています。
rsr.setParameters(new String[]{"SIMPLE_AUTHENTICATION"});
リクエストを構成したら、呼び出しを実行します。
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
管理サービスを初期化します。実行方法の詳細は、こちらを参照してください。
応答を取得するために以下のコードを追加します。(より詳細な情報は、上記応答パラメーターの表を参照してください)
if ("SUCCESS".equals(rs.getStatusCode()) ) { out.write("<br>Success"); String data = rs.getBinaryData(); out.write("<br>ConfigData: " + data); } else { out.write("<br>Failure"); out.write(" Code: " + rs.getErrorCode()); }
完成例
以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。
- コードをコピーして、「ws_loadconfiguration.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_loadconfiguration.jsp」を実行します。
<% /* ws_loadconfiguration.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.*" %> <% AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false); // adjust host and port number AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService(); AdministrationServiceRequest rsr = new AdministrationServiceRequest(); rsr.setLoginId("admin@yellowfin.com.au"); // provide your Yellowfin webservices admin account rsr.setPassword("test"); // change to be the password of the account above rsr.setOrgId(1); rsr.setFunction("LOADCONFIGURATION"); rsr.setParameters(new String[]{"SIMPLE_AUTHENTICATION"}); AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); if ("SUCCESS".equals(rs.getStatusCode()) ) { out.write("<br>Success"); String data = rs.getBinaryData(); out.write("<br>ConfigData: " + data); } else { out.write("<br>Failure"); out.write(" Code: " + rs.getErrorCode()); } %>
リクエストパラメーター
以下の要素は、こちらのリクエストとともに渡されます。
リクエスト要素 | データ型 | 説明 |
LoginId | String | Yellowfin Webサービスに接続する管理者アカウントです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 |
Password | String | 上記アカウントのパスワードです。 |
OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 |
Function | String | Webサービス関数です。こちらは、「LINKDATASOURCE」に設定します。 |
以下のパラメーターは、AdministrationDataSourceClientLinkに提供されます。
パラメーター | 型 | 説明 |
ClientOrgId | Integer | |
ClientOrgRef | String | |
SourceId | Integer | 必須フィールド |
リクエストの例
以下は、こちらのリクエストのSOAP XMLの例です。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/"> <soapenv:Header/> <soapenv:Body> <web:remoteAdministrationCall> <arg0> <loginId>admin@yellowfin.com.au</loginId> <password>test</password> <orgId>1</orgId> <function>LINKDATASOURCE</function> <sourceId>74374</sourceId> <sourceClientLink> <sourceId>74376</sourceId> </sourceClientLink> </arg0> </web:remoteAdministrationCall> </soapenv:Body> </soapenv:Envelope>
応答パラメーター
返される応答には、これらのパラメーターが含まれます。
応答要素 | データ型 | 説明 |
StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。
|
LoadedDataSources | AdministrationDataSource | リンクされたデータソースの詳細を含むオブジェクト配列です。 |
応答の例
サービスは、今回のSOAPの例に基づき、以下の応答を返します。
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/"> <return> <errorCode>0</errorCode> <loadedDataSource> <accessLevelCode>UNSECURE</accessLevelCode> <clientSources> <clientOrgId>13004</clientOrgId> <clientOrgRef>org1</clientOrgRef> <sourceId>74376</sourceId> </clientSources> <connectionDriver>com.mysql.jdbc.Driver</connectionDriver> <connectionPath/> <connectionString>jdbc:mysql://localhost:3306/default</connectionString> <connectionTimeout>180</connectionTimeout> <connectionType>JDBC</connectionType> <connectionTypeCode>GENERICUSER</connectionTypeCode> <inheritChildSourceFilters>false</inheritChildSourceFilters> <maxRows>10000</maxRows> <maxmimumConnections>5</maxmimumConnections> <minimumConnections>1</minimumConnections> <refreshTime>3</refreshTime> <sourceDescription/> <sourceId>74374</sourceId> <sourceName>Default</sourceName> <sourceOptions> <optionKey>ISOLATIONLEVEL</optionKey> <optionValue>1</optionValue> <valueDataType>1</valueDataType> </sourceOptions> <sourceOptions> <optionKey>USESCHEMA</optionKey> <optionValue>true</optionValue> <valueDataType>6</valueDataType> </sourceOptions> <sourceOptions> <optionKey>HOSTNAME</optionKey> <optionValue>localhost</optionValue> <valueDataType>2</valueDataType> </sourceOptions> <sourceOptions> <optionKey>PORT</optionKey> <optionValue>3306</optionValue> <valueDataType>1</valueDataType> </sourceOptions> <sourceOptions> <optionKey>DATABASE</optionKey> <optionValue>default</optionValue> <valueDataType>2</valueDataType> </sourceOptions> <sourceOptions> <optionKey>USEFETCHSIZE</optionKey> <optionValue>false</optionValue> <valueDataType>6</valueDataType> </sourceOptions> <sourceOptions> <optionKey>FETCHSIZE</optionKey> <optionValue/> <valueDataType>2</valueDataType> </sourceOptions> <sourceOptions> <optionKey>YF_DRIVER_SELECTION</optionKey> <optionValue>com.mysql.jdbc.Driver</optionValue> <valueDataType>2</valueDataType> </sourceOptions> <sourceType>MYSQL</sourceType> <timezone>AUSTRALIA/SYDNEY</timezone> <userName>root</userName> <userPassword>kOjvh+lsaec=</userPassword> </loadedDataSource> <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages> <messages>Web Service Request Complete</messages> <sessionId>a8ea7db63b9b96bdcda9e0f9bba067d1</sessionId> <statusCode>SUCCESS</statusCode> </return> </ns2:remoteAdministrationCallResponse> </S:Body> </S:Envelope>
手順
Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。
管理ユーザーとしてのログインと、実行するwebサービスの呼び出しの指定を含む、こちらの関数のリクエストを定義します。
AdministrationServiceRequest rsr = new AdministrationServiceRequest(); rsr.setLoginId("admin@yellowfin.com.au"); rsr.setPassword("test"); rsr.setOrgId(new Integer(1)); rsr.setFunction("LINKDATASOURCE");
デフォルト組織のデータソースのIDを提供します。
rsr.setSourceId(74374);
リンクするクライアント組織のソースIDを提供します。
AdministrationDataSourceClientLink link = new AdministrationDataSourceClientLink(); link.setSourceId(74376); rsr.setSourceClientLink(link);
リクエストを構成したら、呼び出しを実行します。
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
管理サービスを初期化します。実行方法の詳細は、こちらを参照してください。
応答を取得します。(より詳細な情報は、上記応答パラメーターの表を参照してください)
if ("SUCCESS".equals(rs.getStatusCode()) ) { out.write("<br>Success"); } else { out.write("<br>Failure"); out.write(" Code: " + rs.getErrorCode()); }
完成例
以下は、こちらのwebサービスの呼び出しの完成例です。こちらを使用するには、以下の手順に従います。
- コードをコピーして、「ws_linkdatasource.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_linkdatasource.jsp」を実行します。
/* ws_linkdatasource.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.*" %> <% AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false); // adjust host and port number AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService(); AdministrationServiceRequest rsr = new AdministrationServiceRequest(); rsr.setLoginId("admin@yellowfin.com.au"); // provide your Yellowfin web services admin account rsr.setPassword("test"); // change to the password of the account above rsr.setOrgId(1); rsr.setFunction("LINKDATASOURCE"); rsr.setSourceId(74374); AdministrationDataSourceClientLink link = new AdministrationDataSourceClientLink(); link.setSourceId(74376); rsr.setSourceClientLink(link); AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); if ("SUCCESS".equals(rs.getStatusCode()) ) { out.write("<br>Success"); } else { out.write("<br>Failure"); out.write(" Code: " + rs.getErrorCode()); } %>
- No labels