コード例 #1
0
ファイル: rpc.php プロジェクト: Artea/freebeer
 */
@define('AUTH_HANDLER', true);
@define('HORDE_BASE', dirname(__FILE__));
require_once HORDE_BASE . '/lib/base.php';
require_once HORDE_LIBS . 'Horde/RPC.php';
/* Look at the Content-type of the request, if it is available, to try
 * and determine what kind of request this is. */
$input = null;
$params = null;
if (!empty($_SERVER['CONTENT_TYPE'])) {
    if (strstr($_SERVER['CONTENT_TYPE'], 'application/vnd.syncml+xml')) {
        $serverType = 'syncml';
    } elseif (strstr($_SERVER['CONTENT_TYPE'], 'application/vnd.syncml+wbxml')) {
        $serverType = 'syncml_wbxml';
    } elseif (strstr($_SERVER['CONTENT_TYPE'], 'text/xml')) {
        $input = Horde_RPC::getInput();
        /* Check for SOAP namespace URI. */
        if (strstr($input, 'http://schemas.xmlsoap.org/soap/envelope/')) {
            $serverType = 'soap';
        } else {
            $serverType = 'xmlrpc';
        }
    } else {
        header('HTTP/1.0 501 Not Implemented');
        exit;
    }
} else {
    $serverType = 'soap';
}
if ($serverType == 'soap' && (!isset($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] != 'POST')) {
    if (isset($_GET['wsdl'])) {