こちらの関数は、IPを使用して、ユーザーの詳細を取得します。関数は、IPID(Yellowfinリポジトリデータベース内で、これはPersonテーブルのIpIdフィールドになります)を提供することで、ユーザー指定に使用するためのAdministrationPersonオブジェクトを、パラメーターとして受け付けます。応答には、すべてのユーザー詳細を含むAdministrationPersonオブジェクトが含まれます。 リクエスト要素以下の要素は、こちらのリクエストとともに渡されます。 リクエスト要素 | データ型 | 説明 | LoginId | String | ログインをして、この関数を実行する、Webサービス管理者ユーザーのIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 | Password | String | 上記アカウントのパスワードです。 | OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 | Function | String | Webサービス関数です。こちらは、「GETUSERBYIP」に設定します。 | Person | AdministrationPerson | 情報が取得されるユーザーの詳細を含むオブジェクトです。注意:以下の表を参照してください。 |
以下は、こちらの関数のために「AdministrationPerson」オブジェクトに設定しなくてはいけない主要なパラメーターです。 AdministrationPerson要素 | データ型 | 説明 | IpId | Integer| | 情報が取得されるユーザーのIP 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:remoteAdministrationCall>
<arg0>
<loginId>admin@yellowfin.com.au</loginId>
<password>test</password>
<orgId>1</orgId>
<function>GETUSERBYIP</function>
<person>
<ipId>5</ipId>
</person>
</arg0>
</web:remoteAdministrationCall>
</soapenv:Body>
</soapenv:Envelope> |
応答の要素返される応答には、これらののパラメーターが含まれます。 応答要素 | データ型 | 説明 | StatusCode | String | Webサービス呼び出しのステータスです。値の選択肢は、以下の通りです。 | Person | AdministrationPerson | ユーザー詳細を含むオブジェクトです。 |
応答の例サービスは、今回の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>Getting user information...</messages>
<messages>Getting user information...</messages>
<messages>Web Service Request Complete</messages>
<person>
<emailAddress>admin@yellowfin.com.au</emailAddress>
<firstName>System</firstName>
<initial/>
<ipId>5</ipId>
<languageCode>EN</languageCode>
<lastName>Administrator</lastName>
<roleCode>YFADMIN</roleCode>
<salutationCode/>
<status>ACTIVE</status>
<timeZoneCode>AUSTRALIA/SYDNEY</timeZoneCode>
<userId>admin@yellowfin.com.au</userId>
</person>
<sessionId>81e76f1222d0dd12d9871efc7cbf0811</sessionId>
<statusCode>SUCCESS</statusCode>
</return>
</ns2:remoteAdministrationCallResponse>
</S:Body>
</S:Envelope> |
手順Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。 Expand |
---|
| IpIdを提供し、詳細を取得するユーザーを識別するために、AdministrationPersonオブジェクトを使用します。 Code Block |
---|
| AdministrationPerson ap = new AdministrationPerson();
ap.setIpId(5); //IpId of the admin@yellowfin.com.au account
rsr.setPerson(ap); |
リクエストの構成が完了したら、呼び出しを実行します。 Code Block |
---|
| AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr); |
管理Webサービスを初期化します。実行方法の詳細は、こちらを参照してください。
- 応答には、StatusCodeとPersonパラメーターが含まれます。より詳細な情報は、上記の応答パラメーターの表を参照してください。
|
完成例以下は、GETUSERBYIP関数の完成例です。こちらを使用するには、以下の手順に従います。 - コードをコピーして、「ws_getuserbyip.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じた詳細を追加するために、ホスト、ポート番号、管理ユーザー、ユーザーを調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_getuserbyip.jsp」を実行します。
Code Block |
---|
| <%
/* ws_getuserbyip.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 above account
rsr.setOrgId(1);
rsr.setFunction("GETUSERBYIP");
AdministrationPerson ap = new AdministrationPerson();
ap.setIpId(5);
rsr.setPerson(ap);
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
if ("SUCCESS".equals(rs.getStatusCode()) ) {
ap = rs.getPerson();
out.write("User Id: " + ap.getUserId() + "<br>");
out.write("Password: " + ap.getPassword() + "<br>");
out.write("First Name: " + ap.getFirstName() + "<br>");
out.write("Last Name: " + ap.getLastName() + "<br>");
out.write("Initial: " + ap.getInitial() + "<br>");
out.write("Salutation Code: " + ap.getSalutationCode() + "<br>");
out.write("Role Code: " + ap.getRoleCode() + "<br>");
out.write("Email Address: " + ap.getEmailAddress() + "<br>");
out.write("Language Code: " + ap.getLanguageCode() + "<br>");
out.write("IpId: " + ap.getIpId() + "<br>");
out.write("Time Zone Code: " + ap.getTimeZoneCode() + "<br>");
out.write("Status: " + ap.getStatus() + "<br>");
} else {
out.write("Failure");
out.write(" Code: " + rs.getErrorCode() );
}
%> |
|