ウェブサービスFAQ

提供:MoodleDocs
移動先:案内検索


作成中です - Mitsuhiro Yoshida (トーク)

このドキュメントでは、よくある質問をウェブサービスフォーラムからリストアップしています。

ウェブサービスとMNetの違いは何ですか?

MNetはMoodle AサイトからMoodle Bサイトへユーザを認証するために使用されます。

ウェブサービスは外部アプリケーション (SOAP、XML-RPC、REST、AMF等) からコールすることのできる機能です。

様々な場面で用語「ウェブサービス」が使用されています。何を意味しているのですか?

  1. Moodleのシステム全体は「Moodleウェブサービスシステム」と称されます。
  2. 特定の動作 (ユーザ作成等) はウェブサービスの関数として知られています。
  3. 管理者はこれらの関数のグループを外部で利用できるようにすることができます。そして、これらは「ウェブサービス」として知られています。

APIドキュメントはどこにありますか?

異なるMoodleサイトではAPIを拡張および制限できるため、またAPIは時間とともに進化するため、特定のMoodleサイトの正確なAPIを確認するには、自動生成のドキュメンテーションを閲覧してください。

フルAPIドキュメンテーション

  1. 管理者としてログインしてください。
  2. 「管理 > プラグイン > ウェブサービス > APIドキュメンテーション」にアクセスしてください。

ユーザ固有のドキュメンテーション

  1. 管理者としてログインした後、ウェブサービスを有効にして、作成したサービスにMoodleの関数を追加してください。詳細はウェブサービスを使用するをご覧ください。
  2. 非管理者としてログインした後、あなたのセキュリティキーページのサービスドキュメンテーションをご覧ください。

なぜ多くのAPI関数がないのですか?

実装後にAPI関数を変更したくないため、私たちは新しい関数の追加に非常に慎重になっています。私たちがMoodle 2.0に実装している関数は一般的に要求されるもの (ユーザ、コース、グループ、登録) です。

We will add more functions to core over time, based on contributions from the community and feature requests. See the web service roadmap.

You can also extend the API on your own Moodle site by creating your own API functions (see next question).

どのようにすれば、ウェブサービス関数を作成できますか?

The easiest and recommended way to add a web service is to write a new Moodle local plugin and to implement the web service functions there. The Moodle administrator will just need to add the plugin in Moodle (copy the files in /local/), the web service functions will be automatically added. Please read /local/readme.txt for more information about plugin development. Finally read how to implement a web service and a web service function.

どのようにウェブサービスをセットアップすれば良いですか?

Moodle SOAPサーバはJAVAまたは.NETと動作しますか?

Unfortunately the generated WSDL isn't currently compatible with JAVA or .NET. See MDL-28988 and MDL-28989 for plans to create a JAVA-compatible SOAP WSDL.

どのようにして外部アプリケーションからユーザトークンを所得しますか?

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.

関連情報