ウェブサービスFAQ
作成中です - Mitsuhiro Yoshida (トーク)
このドキュメントでは、よくある質問をウェブサービスフォーラムからリストアップしています。
ウェブサービスとMNetの違いは何ですか?
MNetはMoodle AサイトからMoodle Bサイトへユーザを認証するために使用されます。
ウェブサービスは外部アプリケーション (SOAP、XML-RPC、REST、AMF等) からコールすることのできる機能です。
様々な場面で用語「ウェブサービス」が使用されています。何を意味しているのですか?
- Moodleのシステム全体は「Moodleウェブサービスシステム」と称されます。
- 特定の動作 (ユーザ作成等) はウェブサービスの関数として知られています。
- 管理者はこれらの関数のグループを外部で利用できるようにすることができます。そして、これらは「ウェブサービス」として知られています。
APIドキュメントはどこにありますか?
異なるMoodleサイトではAPIを拡張および制限できるため、またAPIは時間とともに進化するため、特定のMoodleサイトの正確なAPIを確認するには、自動生成のドキュメンテーションを閲覧してください。
フルAPIドキュメンテーション
- 管理者としてログインしてください。
- 「管理 > プラグイン > ウェブサービス > APIドキュメンテーション」にアクセスしてください。
ユーザ固有のドキュメンテーション
- 管理者としてログインした後、ウェブサービスを有効にして、作成したサービスにMoodleの関数を追加してください。詳細はウェブサービスを使用するをご覧ください。
- 非管理者としてログインした後、あなたのセキュリティキーページのサービスドキュメンテーションをご覧ください。
なぜ多くのAPI関数がないのですか?
実装後にAPI関数を変更したくないため、私たちは新しい関数の追加に非常に慎重になっています。私たちがMoodle 2.0に実装している関数は一般的に要求されるもの (ユーザ、コース、グループ、登録) です。
コミュニティからの寄稿および機能リクエストに基づき、私たちは徐々に関数を追加する予定です。詳細はウェブサービスロードマップをご覧ください。
オリジナルのAPI関数を作成することで、あなたのMoodleサイトでAPIを拡張することもできます (次の質問をご覧ください)。
どのようにすれば、ウェブサービス関数を作成できますか?
ウェブサービスを追加するための最も簡単で、お勧めの方法は新しいMoodleローカルプラグインを書いて、そこにウェブサービスを実装する方法です。Moodle管理者がMoodleにプラグインを追加 (ファイルを /local/ にコピー) するだけで、ウェブサービス関数が自動的に追加されます。プラグインの開発に関して、詳細は「/local/readme.txt」をご覧ください。最後にウェブサービスのおよびウェブサービス関数の実装方法をご覧ください。
どのようにウェブサービスをセットアップすれば良いですか?
- ドキュメントウェブサービスを作成および有効にする方法をご覧ください。
- 「設定 > サイト管理 > プラグイン > 概要」では、2つの使用例を説明しています。
- 最後にウェブサービスフォーラムで質問を尋ねてください。
Moodle SOAPサーバはJAVAまたは.NETと動作しますか?
残念ですが、現在のところ、生成されるWSDLはJAVAまたは.NETとの互換性がありません。JAVA互換SOAP WSDLの作成プランに関して、MDL-28988およびMDL-28989をご覧ください。
どのようにして外部アプリケーションからユーザトークンを所得しますか?
you can generate and retrieve user tokens with the /login/token.php file => How to get a user token
「アクセスコントロール例外」エラーとは何ですか?
It means that one of this admin setting has failed:
- authorised user: ip restriction fails to authenticate the user (Administration > Plugins > Web services > Manage services > Authorized users > click on user full name)
- authorised user: valid date is expired (Administration > Plugins > Web services > Manage services > Authorized users > click on user full name)
- admin created the token: ip restriction fails to authenticate the user (Administration > Plugins > Web services > Manage tokens > check the status)
- admin created the token: valid date is expired (Administration > Plugins > Web services > Manage tokens > check the status)
- the user is not listed in the authorized list (Administration > Plugins > Web services > Manage services > Authorized users)
- the user hasn't the required capability (Administration > Plugins > Web services > Manage services > Edit service)
- site in maintenance mode
- user is suspended
- user is not confirmed
- user is deleted
- the user authentication is set to nologin (edit the user profile)
- password expired (most likely happens with external authentication like LDAP)
- web service disabled (Administration > Advanced features)
- user doesn't have the capability to use the used web service protocol (user should have the capability 'webservice/use:xmlrpc'/'webservice/use:rest'/..., on SYSTEM context).
- the user token doesn't exist
- the web service function is not included in the service
Since Moodle 2.2, if the administrator turns Moodle debug mode >= NORMAL, then an explicit error message will be returned.
関連情報
- Using Moodle ウェブサービスフォーラム - 英語