ウェブサービス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に実装している関数は一般的に要求されるもの (ユーザ、コース、グループ、登録) です。

コミュニティからの寄稿および機能リクエストに基づき、私たちは徐々に関数を追加する予定です。詳細はウェブサービスロードマップをご覧ください。

オリジナルのAPI関数を作成することで、あなたのMoodleサイトでAPIを拡張することもできます (次の質問をご覧ください)。

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

ウェブサービスを追加するための最も簡単で、お勧めの方法は新しいMoodleローカルプラグインを書いて、そこにウェブサービスを実装する方法です。Moodle管理者がMoodleにプラグインを追加 (ファイルを /local/ にコピー) するだけで、ウェブサービス関数が自動的に追加されます。プラグインの開発に関して、詳細は「/local/readme.txt」をご覧ください。最後にウェブサービスのおよびウェブサービス関数の実装方法をご覧ください。

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

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

残念ですが、現在のところ、生成されるWSDLはJAVAまたは.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.

関連情報