こちらの関数は、Yellowfinに新規ユーザーアカウントを作成します。 リクエストパラメーター以下の要素は、こちらのリクエストとともに渡されます。 リクエスト要素 | データ型 | 説明 | LoginId | String | Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 | Password | String | 上記アカウントのパスワードです。 | OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 | Function | String | Webサービス関数です。こちらは、「ADDUSER」に設定します。 | Person | AdministrationPerson | ユーザー作成プロセスに関する新規ユーザーの詳細のすべてを含むオブジェクトです。以下の表を参照してください。 | OrgRef | String | クライアント組織内部参照IDです(こちらの設定はオプションです)。こちらは、参照されるクライアント組織に新規ユーザーを作成します。こちらを設定しない場合、新規ユーザーはデフォルト(プライマリー)組織内に作成されます。 |
以下は、新規ユーザーを作成するために、「AdministrationPerson」オブジェクトに設定しなくてはいけない必須のパラメーターです。AdministrationPerson 要素 | データ型 | 説明 | UserId | String | 新規ユーザーのユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 | Password | String | 新規ユーザーのパスワードです。こちらは、Yellowfinのパスワードポリシーに準拠する必要があります。 | FirstName | String | 新規ユーザーの名です。 | LastName | String | 新規ユーザーの姓です。 | RoleCode | String | 新規ユーザーのロールを設定します。例:YFREPORTCONSUMER 注意:リポジトリデータベースから、Yellowfinのロールコードの一覧を取得することができます。例:SQLクエリーを使用する場合:SELECT * FROM OrgRole | EmailAddress | String | 新規ユーザーの電子メールアドレスです。 |
リクエストの例以下のSOAP XMLの例は、この呼び出しに渡すことのできるパラメーターを表示しています。 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:remoteAdministrationCall>
<arg0>
<loginId>admin@yellowfin.com.au</loginId>
<password>test</password>
<orgId>1</orgId>
<function>ADDUSER</function>
<person>
<userId>binish.sheikh@yellowfin.com.au</userId>
<emailAddress>binish.sheikh@yellowfin.com.au</emailAddress>
<password>admin</password>
<firstName>Binish</firstName>
<lastName>Sheikh</lastName>
<roleCode>YFREPORTCONSUMER</roleCode>
</person>
</arg0>
</web:remoteAdministrationCall>
</soapenv:Body>
</soapenv:Envelope> |
応答パラメーター返される応答には、これらのパラメーターが含まれます。 応答要素 | データ型 | 説明 | StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。 |
応答の例サービスは、今回のSOAPの例に基づき、以下の応答を返します。 Code Block |
---|
| <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>Creating New User via Webservices...</messages>
<messages>Creating SessionBean for webservices user...</messages>
<messages>Looking up user...</messages>
<messages>Web Service Request Complete</messages>
<sessionId>8090cb7879f7d5e72eab9625772c00b5</sessionId>
<statusCode>SUCCESS</statusCode>
</return>
</ns2:remoteAdministrationCallResponse>
</S:Body>
</S:Envelope> |
手順Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。 Expand |
---|
| こちらは、Yellowfinの新規ユーザーを作成する基礎的なリクエストであり、管理ユーザーとしてのログインと、実行するWebサービスの呼び出しの指定を含みます。
Code Block |
---|
| AdministrationServiceRequest rsr = new AdministrationServiceRequest();
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(1);
rsr.setFunction("ADDUSER"); |
特定のクライアント組織に新規ユーザーを作成する場合は、こちらをコードに追加します。
Code Block |
---|
| rsr.setOrgRef("org1"); // A new user will be added to the client org with "org1" as an organization reference ID |
orgRefパラメーターを定義しない場合は、新規ユーザーはデフォルト(プライマリー)組織内に作成されます。
リクエストに「ap」オブジェクトを渡します。
Code Block |
---|
| rsr.setPerson(ap); |
- 返される応答には、StatusCodeパラメーターが含まれます。詳細については、上記の応答パラメーターの表を参照してください。
|
完成例以下は、ADDUSER関数の完成例です。こちらを使用するには、以下の手順に従います。 - コードをコピーして、「ws_adduser.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じた詳細を追加するために、ホスト、ポート番号、管理ユーザー、ユーザーを調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_adduser.jsp」を実行します。
Code Block |
---|
| <%
/* ws_adduser.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 service admin account
rsr.setPassword("test"); // change this to the password of the above account
rsr.setOrgId(1);
rsr.setFunction("ADDUSER");
AdministrationPerson ap = new AdministrationPerson();
ap.setUserId("john.smith@yellowfin.com.au"); // If Yellowfin authentication option is set to "email address"
ap.setFirstName("John");
ap.setLastName("Smith");
ap.setRoleCode("YFREPORTCONSUMER"); // Yellowfin role codes can be found performing this query against
// Yellowfin configuration database: SELECT * FROM OrgRole
ap.setPassword("test"); // Password must comply with your Yellowfin password policy
ap.setEmailAddress("john.smith@yellowfin.com.au");
rsr.setPerson(ap);
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
if
("SUCCESS".equals(rs.getStatusCode()) ) {
out.write("Success");
} else {
out.write("Failure");
out.write(" Code: " + rs.getErrorCode());
}
%> |
|