Hinweis: Sie sind auf den Seiten der Moodle 2.0 Dokumentation. Die Dokumentation der aktuellsten Moodle-Version finden Sie hier: Webservices FAQ.

Webservices FAQ: Unterschied zwischen den Versionen

Aus MoodleDocs
Wechseln zu:Navigation, Suche
(Die Seite wurde neu angelegt: „{{Webservices}} {{Zum Übersetzen}} This document lists some popular questions from the [http://moodle.org/mod/forum/view.php?id=6971 Web Services forum]. == Wh…“)
 
Keine Bearbeitungszusammenfassung
Zeile 2: Zeile 2:


{{Zum Übersetzen}}
{{Zum Übersetzen}}
This document lists some popular questions from the [http://moodle.org/mod/forum/view.php?id=6971 Web Services forum].
Dieser Artikel gibt Antwort auf einige häufig gestellte Fragen aus dem [http://moodle.org/mod/forum/view.php?id=6971 Web Services Forum] auf moodle.org.


== What is the difference between web services and MNet ==


[[MNet]] is used to authenticate some users from a Moodle A site into a Moodle B site.


Web services are functions that can be called by external applications (via SOAP, XML-RPC, REST or AMF).
== Was ist der Unterschied zwischen einem Webservice und MNet? ==


== I see the term "Web services" used in different ways, what does it mean? ==
[[MNet]] wird verwendet, um Nutzer/innen einer Moodle-Site '''A''' in einer Moodle-Site '''B''' zu authentifizieren.


# The entire system in Moodle is referred to as the Moodle Web Service system.
Webservices sind Funktionen, die von externen Applikationen in Moodle aufgerufen werden (über SOAP, XML-RPC, REST oder AMF).
# A particular action (like creating a user) is known as a Web service '''function'''.
# The admin can enable groups of these functions for outside use, and these are known as a "Web service".


== Where is the Web Service API documented? ==
== Der Begriff "Webservices" wird in verschiedenen Zusammenhängen verwendet, was bedeutet er? ==


Since different Moodle sites can extend or restrict the API, and the API will evolve over time, the best way to see the exact API for a particular Moodle site is to look at the automatically generated documentation.
# Das gesamte Webservices-System in Moodle wird als Moodle-Webservice-System bezeichnet.
# Eine einzelne Aktion (z.B. das Anlegen eines Nutzers) wird als Webservice-Funktion bezeichnet.
# Als Administrator/in können Sie mehrere dieser Funktionen für die Verwendung "von außen" aktivieren, und diese Funktionen werden als "Webservice" bezeichnet.


'''Full API documentation'''
== Wo ist die Webservice API dokumentiert? ==
# Connect as admin
Da verschiedene Moodle-Sites die API erweitern oder einschränken können, ändert sich die API im Laufe der Zeit. Die beste Möglichkeit, die genaue API für eine spezielle Moodle-Site zu sehen, ist, sich die automatisch generierte Dokumentation anzusehen.
# Go to Administration Settings block > Plugins > Web services > API documentation


'''Specific documentation to a user'''
'''Vollständige API Dokumentation'''
# Connect as admin, enable web service, create a service and add some Moodle functions to it. Also see [[How_to_create_and_enable_a_web_service]].
# Melden Sie sich als Administrator/in an.
# connect as non admin, and access the service documentation on your [[How_to_get_a_security_key|security keys page]].
# Gehen Sie auf die Seite ''[[Einstellungen-Block|Einstellungen]] > Website-Administration > Plugins > Webservices > API Dokumentation''.


== Why are there not many functions in the API? ==
'''Spezifische Dokumentation für Nutzer/innen'''
# Melden Sie sich als Administrator/in an, aktivieren Sie [[Webservices]] als Zusatzoption, legen Sie einen Webservice an und fügen Sie einige Moodle-Funktionen zu diesem Service hinzu, siehe [[Webservices nutzen]].
# Melden Sie sich als Nicht-Admin an und gehen Sie auf Ihre [[Sicherheitsschlüssel]]-Seite.


We have been very careful when adding new functions because we don't want to be changing the API functions once they are implemented. The ones we have in Moodle 2.0 are the most commonly requested ones (for users, courses, groups and enrolments).   
== Warum gibt es in der API nur wenige Funktionen? ==
Wir sind sehr vorsichtig mit dem Hinzufügen von Funktionen, weil wir die API der Funktionen möglichst nicht ändern möchten, sobald sie einmal implementiert sind. Die Funktionen, die es in Moodle 2 gibt, waren die am meisten geforderten (für Nutzer/innen, Kurse, Gruppen und Einschreibungen).   


We will add more functions to core over time, based on contributions from the community and feature requestsSee the [[:dev:Web_services_Roadmap|web service roadmap]].
Mit der Zeit werden wir weitere Funktionen hinzufügen, basiert auf die Beiträge der Community und gestellte AnforderungenSiehe [[:dev:Web_services_Roadmap|Webservices Roadmap]].


You can also extend the API on your own Moodle site by creating your own API functions (see next question).
Sie können auch die API in Ihrer eigenen Moodle-Site erweitern, indem Sie eigene API-Funktionen implementieren (siehe nächste Frage).


== How can I create a new web service function? ==
== Wie kann ich eine neue Webservice-Funktion implementieren? ==
Der einfachste und empfohlene Weg ist es, ein neues lokales Moodle-Plugin zu entwickeln und die Webservice-Funktionen dort zu implementieren. Die Moodle-Administration muss dieses Plugin dann nur in Moodle installieren (im Verzeichnis ''/moodle/local/''), die Webservice-Funktionen werden automatisch angelegt. Weitere Informationen zur Plugin-Entwicklung finden Sie in der Datei ''/moodle/local/readme.txt''. Lesen Sie außerdem die Entwickler-Dokumentation, siehe [[:dev:Creating_a_web_service_and_a_web_service_function|how to implement a web service and a web service function]].


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  [[:dev:Creating_a_web_service_and_a_web_service_function|how to implement a web service and a web service function]].
== Wie kann ich einen Webservice aufsetzen? ==


== How can I set up a web service? ==
* Siehe [[Webservices nutzen]]the document [[How_to_create_and_enable_a_web_service| How to create and enable a web service]].
* Auf der Seite ''''[[Einstellungen-Block|Einstellungen]] > Website-Administration > Plugins > Webservices > Übersicht'' finden Sie zwei Anwendungsbeispiele.
* Wenn Sie Fragen haben, nutzen Sie das [http://moodle.org/mod/forum/view.php?id=6971 Webservices Forum] auf moodle.org.


* See the document [[How_to_create_and_enable_a_web_service| How to create and enable a web service]].  
== Arbeitet der Moodle SOAP Server mit JAVA oder .NET? ==
* ''Settings > Site administration > Plugins > Web services > Overview'' explains two use cases.
Leider ist das generierte WSDL momentan nicht kompatibel mit JAVA oder .NET. Siehe MDL-28988 und MDL-28989 für Pläne, ein JAVA-kompatibles SOAP WSDL zu generieren.
* Finally ask questions on the [http://moodle.org/mod/forum/view.php?id=6971 Web Services forum]


== Does the Moodle SOAP server work with JAVA or .NET? ==
== Wie bekomme ich ein Nutzer-Token von einer externen Applikation? ==
Nutzen Sie das PHP-Skript ''/moodle/login/token.php'', siehe Entwickler-Dokumentation [[:dev:Creating_a_web_service_client#How_to_get_a_user_token|How to get a user token]].


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.
== Was bedeutet die Fehlermeldung ''Access control exception''? ==
 
== How to get a user token from an external application? ==
you can generate and retrieve user tokens with the /login/token.php file => [[:dev:Creating_a_web_service_client#How_to_get_a_user_token|How to get a user token]]
 
== What is the 'Access control exception' error ==
It means that one of this admin setting has failed:
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: ip restriction fails to authenticate the user (Administration > Plugins > Web services > Manage services > Authorized users > click on user full name)
Zeile 74: Zeile 72:
Since Moodle 2.2, if the administrator turns Moodle debug mode >= NORMAL, then an explicit error message will be returned.
Since Moodle 2.2, if the administrator turns Moodle debug mode >= NORMAL, then an explicit error message will be returned.


==See also==
==Siehe auch==


* Using Moodle [http://moodle.org/mod/forum/view.php?id=6971 Web Services forum]
* [http://moodle.org/mod/forum/view.php?id=6971 Webservices Forum] - Diskussionsforum im Kurs ''Using Moodle'' auf moodle.org


[[Category:Moodle-Netzwerk]]
[[Category:Moodle-Netzwerk]]

Version vom 13. Juni 2012, 18:45 Uhr


Baustelle.png Diese Seite ist noch nicht vollständig übersetzt.

Dieser Artikel gibt Antwort auf einige häufig gestellte Fragen aus dem Web Services Forum auf moodle.org.


Was ist der Unterschied zwischen einem Webservice und MNet?

MNet wird verwendet, um Nutzer/innen einer Moodle-Site A in einer Moodle-Site B zu authentifizieren.

Webservices sind Funktionen, die von externen Applikationen in Moodle aufgerufen werden (über SOAP, XML-RPC, REST oder AMF).

Der Begriff "Webservices" wird in verschiedenen Zusammenhängen verwendet, was bedeutet er?

  1. Das gesamte Webservices-System in Moodle wird als Moodle-Webservice-System bezeichnet.
  2. Eine einzelne Aktion (z.B. das Anlegen eines Nutzers) wird als Webservice-Funktion bezeichnet.
  3. Als Administrator/in können Sie mehrere dieser Funktionen für die Verwendung "von außen" aktivieren, und diese Funktionen werden als "Webservice" bezeichnet.

Wo ist die Webservice API dokumentiert?

Da verschiedene Moodle-Sites die API erweitern oder einschränken können, ändert sich die API im Laufe der Zeit. Die beste Möglichkeit, die genaue API für eine spezielle Moodle-Site zu sehen, ist, sich die automatisch generierte Dokumentation anzusehen.

Vollständige API Dokumentation

  1. Melden Sie sich als Administrator/in an.
  2. Gehen Sie auf die Seite Einstellungen > Website-Administration > Plugins > Webservices > API Dokumentation.

Spezifische Dokumentation für Nutzer/innen

  1. Melden Sie sich als Administrator/in an, aktivieren Sie Webservices als Zusatzoption, legen Sie einen Webservice an und fügen Sie einige Moodle-Funktionen zu diesem Service hinzu, siehe Webservices nutzen.
  2. Melden Sie sich als Nicht-Admin an und gehen Sie auf Ihre Sicherheitsschlüssel-Seite.

Warum gibt es in der API nur wenige Funktionen?

Wir sind sehr vorsichtig mit dem Hinzufügen von Funktionen, weil wir die API der Funktionen möglichst nicht ändern möchten, sobald sie einmal implementiert sind. Die Funktionen, die es in Moodle 2 gibt, waren die am meisten geforderten (für Nutzer/innen, Kurse, Gruppen und Einschreibungen).

Mit der Zeit werden wir weitere Funktionen hinzufügen, basiert auf die Beiträge der Community und gestellte Anforderungen. Siehe Webservices Roadmap.

Sie können auch die API in Ihrer eigenen Moodle-Site erweitern, indem Sie eigene API-Funktionen implementieren (siehe nächste Frage).

Wie kann ich eine neue Webservice-Funktion implementieren?

Der einfachste und empfohlene Weg ist es, ein neues lokales Moodle-Plugin zu entwickeln und die Webservice-Funktionen dort zu implementieren. Die Moodle-Administration muss dieses Plugin dann nur in Moodle installieren (im Verzeichnis /moodle/local/), die Webservice-Funktionen werden automatisch angelegt. Weitere Informationen zur Plugin-Entwicklung finden Sie in der Datei /moodle/local/readme.txt. Lesen Sie außerdem die Entwickler-Dokumentation, siehe how to implement a web service and a web service function.

Wie kann ich einen Webservice aufsetzen?

Arbeitet der Moodle SOAP Server mit JAVA oder .NET?

Leider ist das generierte WSDL momentan nicht kompatibel mit JAVA oder .NET. Siehe MDL-28988 und MDL-28989 für Pläne, ein JAVA-kompatibles SOAP WSDL zu generieren.

Wie bekomme ich ein Nutzer-Token von einer externen Applikation?

Nutzen Sie das PHP-Skript /moodle/login/token.php, siehe Entwickler-Dokumentation How to get a user token.

Was bedeutet die Fehlermeldung Access control exception?

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.

Siehe auch