Пример #1
0
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * SOAP web service entry point. The authentication is done via tokens.
 *
 * @package    webservice_soap
 * @copyright  2009 Jerome Mouneyrac
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
/**
 * NO_DEBUG_DISPLAY - disable moodle specific debug messages and any errors in output
 */
define('NO_DEBUG_DISPLAY', true);
/**
 * NO_MOODLE_COOKIES - no cookies with web service
 */
define('NO_MOODLE_COOKIES', true);
require '../../config.php';
require_once "{$CFG->dirroot}/webservice/soap/locallib.php";
if (!webservice_protocol_is_enabled('soap')) {
    die;
}
$server = new webservice_soap_server(WEBSERVICE_AUTHMETHOD_PERMANENT_TOKEN);
$server->run();
die;
Пример #2
0
 /**
  * Handle a request.
  *
  * NOTE: this is basically a copy of the Zend handle()
  *       but with $soap->fault returning faultactor + faultdetail
  *       So we don't require coding style checks within this method
  *       to keep it as similar as the original one.
  *
  * Instantiates SoapServer object with options set in object, and
  * dispatches its handle() method.
  *
  * $request may be any of:
  * - DOMDocument; if so, then cast to XML
  * - DOMNode; if so, then grab owner document and cast to XML
  * - SimpleXMLElement; if so, then cast to XML
  * - stdClass; if so, calls __toString() and verifies XML
  * - string; if so, verifies XML
  *
  * If no request is passed, pulls request using php:://input (for
  * cross-platform compatability purposes).
  *
  * @param DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request Optional request
  * @return void|string
  * @deprecated since 3.1, see {@link webservice_soap_server::handle()}.
  */
 public function handle($request = null)
 {
     debugging('moodle_zend_soap_server::handle() is deprecated, please use webservice_soap_server::handle() instead.', DEBUG_DEVELOPER);
     parent::handle();
 }