Exemplo n.º 1
0
                return array($insert_id_callback, 'result=Success', " Success - Callback request has been accepted ");
            } else {
                $error_msg = 'Error : You don t have enough credit to call you back !!!';
            }
        } else {
            $error_msg = 'Error : There is no route to call back your phonenumber !!!';
        }
        // CALLBACK FAIL
        write_log(LOG_CALLBACK, "error_msg = {$error_msg}");
        return array($insert_id_callback, 'result=Error', " ERROR - {$error_msg}");
    }
}
// end Class
$server = new SOAP_Server();
$webservice = new Callback();
// TEST WITH SOAP
// $webservice -> Request(md5(API_SECURITY_KEY), '1234567896', '2342354324', '223424234', $callback_time, $uniqueid);
// exit;
$server->addObjectMap($webservice, 'http://schemas.xmlsoap.org/soap/envelope/');
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    $server->service($HTTP_RAW_POST_DATA);
} else {
    // Create the DISCO server
    $disco = new SOAP_DISCO_Server($server, 'Callback');
    header("Content-type: text/xml");
    if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
        echo $disco->getWSDL();
    } else {
        echo $disco->getDISCO();
    }
}
Exemplo n.º 2
0
$server->_auto_translation = true;
/* This is a simple example of implementing a custom
   call handler.  If you do this, the soap server will ignore
   objects or functions added to it, and will call your handler
   for **ALL** soap calls the server receives, wether the call
   is defined in your WSDL or not.  The handler receives two
   arguments, the method name being called, and the arguments
   sent for that call.
*/
function myCallHandler($methodname, $args)
{
    global $soapclass;
    return @call_user_func_array(array($soapclass, $methodname), $args);
}
$server->setCallHandler('myCallHandler', false);
require_once 'example_server.php';
$soapclass = new SOAP_Example_Server();
$server->addObjectMap($soapclass, 'urn:SOAP_Example_Server');
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    $server->service($HTTP_RAW_POST_DATA);
} else {
    require_once 'SOAP/Disco.php';
    $disco = new SOAP_DISCO_Server($server, 'ServerExample');
    header("Content-type: text/xml");
    if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
        echo $disco->getWSDL();
    } else {
        echo $disco->getDISCO();
    }
    exit;
}
        } else {
            if (is_object($inputStruct)) {
                $inputStruct = get_object_vars($inputStruct);
            }
            $struct = new SOAPStruct($inputStruct['varString'], $inputStruct['varInt'], $inputStruct['varFloat']);
            return $struct->__to_soap($ns . 'echoStructReturn');
        }
    }
}
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
$options = array('use' => 'literal', 'style' => 'document');
$groupd = new SOAP_Interop_GroupDDocLit();
$server = new SOAP_Server($options);
$server->_auto_translation = true;
$server->addObjectMap($groupd, 'http://soapinterop.org/WSDLInteropTestDocLit');
$server->addObjectMap($groupd, 'http://soapinterop.org/xsd');
$server->bind('http://localhost/soap_interop/wsdl/InteropTestDocLit.wsdl.php');
if (isset($_SERVER['SERVER_NAME'])) {
    $server->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : NULL);
} else {
    // allows command line testing of specific request
    $test = '<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:ns4="http://soapinterop.org/xsd"
>
<SOAP-ENV:Body>
        $ra = array();
        if ($inputStructArray) {
            $c = count($inputStructArray);
            for ($i = 0; $i < $c; $i++) {
                $ra[] = $inputStructArray[$i]->__to_soap('item');
            }
        }
        return $ra;
    }
}
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
$groupd = new SOAP_Interop_GroupDImport3();
$server = new SOAP_Server();
$server->_auto_translation = true;
$server->addObjectMap($groupd, 'http://soapinterop/');
$server->addObjectMap($groupd, 'http://soapinterop.org/xsd');
$server->bind('http://localhost/soap_interop/wsdl/import3.wsdl.php');
if (isset($_SERVER['SERVER_NAME'])) {
    $server->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : null);
} else {
    // allows command line testing of specific request
    $test = '<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:ns4="http://soapinterop.org/xsd"
 xmlns:ns5="http://soapinterop/"
 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            }
        }
        return new SOAP_Value('echoStringArrayReturn', null, $ra);
    }
    function echoStruct($inputStruct)
    {
        if (is_object($inputStruct) && strtolower(get_class($inputStruct)) == 'soapstruct') {
            return $inputStruct->__to_soap('return');
        } else {
            if (is_object($inputStruct)) {
                $inputStruct = get_object_vars($inputStruct);
            }
            $struct = new SOAPStruct($inputStruct['varString'], $inputStruct['varInt'], $inputStruct['varFloat']);
            return $struct->__to_soap('return');
        }
    }
    function echoVoid()
    {
        return null;
    }
}
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
$groupd = new SOAP_Interop_GroupDRpcEnc();
$server = new SOAP_Server();
$server->_auto_translation = true;
$server->addObjectMap($groupd, 'http://soapinterop/');
$server->addObjectMap($groupd, 'http://soapinterop.org/xsd');
$server->addObjectMap($groupd, 'http://soapinterop.org/WSDLInteropTestRpcEnc');
$server->bind('http://localhost/soap_interop/wsdl/InteropTestRpcEnc.wsdl.php');
$server->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : null);
require_once 'params_classes.php';
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
class SOAP_Interop_GroupDImport1
{
    function echoString($inputString)
    {
        return new SOAP_Value('Result', 'string', $inputString);
    }
}
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
$groupd = new SOAP_Interop_GroupDImport1();
$server = new SOAP_Server();
$server->_auto_translation = true;
$server->addObjectMap($groupd, 'http://soapinterop/echoString/');
$server->bind('http://localhost/soap_interop/wsdl/import1.wsdl.php');
if (isset($_SERVER['SERVER_NAME'])) {
    $server->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : null);
} else {
    // allows command line testing of specific request
    $test = '<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:ns4="http://soapinterop/echoString/"
 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
Exemplo n.º 7
0
define('SF_APP', 'app');
define('SF_ENVIRONMENT', 'soap');
define('SF_DEBUG', true);
require_once 'SOAP/Server.php';
//require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
require_once dirname(__FILE__) . '/../config/ProjectConfiguration.class.php';
$configuration = ProjectConfiguration::getApplicationConfiguration('app', 'prod', false);
sfContext::createInstance($configuration);
$webservice = new soapCliController();
/* Create a new SOAP server using PEAR::SOAP's SOAP_Server class: */
$server = new SOAP_Server();
/* Create an instance of our class: */
//  $webservice = new mySoapServer();
/* Register this instance to the server class: */
// $server->addObjectMap($soaphelloserver,array('namespace'=> 'urn:helloworld'));
$server->addObjectMap($webservice, 'urn:soapCliController');
// $server = new Soap_Server(); //this file is defined in the next step
// $server->addObjectMap($soap_c,array('namespace'=> 'urn:soapapi'));
// $server->setClass("mySoapController"); // more to come on this one
// $server->handle();
// set the path finder class as default responder for the WSDL class
// $server->addObjectMap($webservice,'http://schemas.xmlsoap.org/soap/envelope/');
// start serve
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    $server->service($HTTP_RAW_POST_DATA);
} else {
    $disco = new SOAP_DISCO_Server($server, 'soapCliController');
    header("Content-type: text/xml");
    if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
        // show only the WSDL/XML output if ?wsdl is set in the address bar
        echo $disco->getWSDL();
Exemplo n.º 8
0
        # well, lets imagine here some code for adding given mp3track to db or whatever...
        $MethodDebug["rc"] = new SOAP_Value("rc", "boolean", true);
        $MethodDebug["ErrNo"] = new SOAP_Value("ErrNo", "int", (int) 0);
        $MethodDebug["Error"] = new SOAP_Value("Error", "string", "");
        return new SOAP_Value('return', '{urn:MP3DB}AddMP3TrackResult', array("MethodDebug" => new SOAP_Value('MethodDebug', '{urn:MP3DB}MethodDebug', $MethodDebug)));
    }
    function __dispatch($methodname)
    {
        if (isset($this->__dispatch_map[$methodname])) {
            return $this->__dispatch_map[$methodname];
        }
        return NULL;
    }
}
$server = new SOAP_Server();
$server->_auto_translation = true;
$MP3DB_Class = new MP3DB_Class();
$server->addObjectMap($MP3DB_Class, 'urn:MP3DB');
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    $server->service($HTTP_RAW_POST_DATA);
} else {
    require_once 'SOAP/Disco.php';
    $disco = new SOAP_DISCO_Server($server, "MP3DB");
    header("Content-type: text/xml");
    if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
        echo $disco->getWSDL();
    } else {
        echo $disco->getDISCO();
    }
    exit;
}
Exemplo n.º 9
0
<?php

require_once '../includes.php';
require_once '../classes/classQuota.php';
$check_remoter = validRemoteIP($_SERVER['REMOTE_ADDR']);
$server = new SOAP_Server();
$server->_auto_translation = true;
$classObj = new CQuota($check_remoter);
$server->addObjectMap($classObj, 'urn:CQuota');
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    $server->service($HTTP_RAW_POST_DATA);
} else {
    require_once 'SOAP/Disco.php';
    $disco = new SOAP_DISCO_Server($server, "CQuota");
    header("Content-type: text/xml");
    if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
        echo $disco->getWSDL();
    } else {
        echo $disco->getDISCO();
    }
    exit;
}
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
class SOAP_Interop_GroupDCompound2
{
    function echoEmployee(&$employee)
    {
        return $employee->__to_soap('result_Employee');
    }
}
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
$options = array('use' => 'literal', 'style' => 'document');
$groupd = new SOAP_Interop_GroupDCompound2();
$server = new SOAP_Server($options);
$server->_auto_translation = true;
$server->addObjectMap($groupd, 'http://soapinterop.org/employee');
$server->bind('http://localhost/soap_interop/wsdl/compound2.wsdl.php');
if (isset($_SERVER['SERVER_NAME'])) {
    $server->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : NULL);
} else {
    $test = '<?xml version="1.0" encoding="UTF-8"?>
    
    <SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
     xmlns:ns4="http://soapinterop.org/person"
     xmlns:ns5="http://soapinterop.org/employee"
    >
    <SOAP-ENV:Body>
    
Exemplo n.º 11
0
<?php

require_once 'includes.php';
require_once "classVCB.php";
$check_remoter = validRemoteIP($_SERVER['REMOTE_ADDR']);
$server = new SOAP_Server();
$server->_auto_translation = true;
$vcb = new CVCB($check_remoter);
$server->addObjectMap($vcb, 'urn:CVCB');
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    $server->service($HTTP_RAW_POST_DATA);
} else {
    require_once 'SOAP/Disco.php';
    $disco = new SOAP_DISCO_Server($server, "CVCB");
    header("Content-type: text/xml");
    if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
        echo $disco->getWSDL();
    } else {
        echo $disco->getDISCO();
    }
    exit;
}
Exemplo n.º 12
0
<?
// handles remote queries with soap

/*
    *** REQUIREMENTS FOR USING the version of PEAR:SOAP that this code uses: ***
    SOAP-0.9.3
    HTTP_Request >= 1.3.0
    Net_URL >= 1.0.14
*/
if (!defined('DILPS_SOAP_QUERY')) define('DILPS_SOAP_QUERY', 1);
error_reporting(0);  // suppress warnings related to unfound (and unnecessary) soap include files
require_once('./config.inc.php');
require_once("{$config['includepath']}dilpsSoapServer.class.php");
require_once('SOAP/Server.php');

// Create the SOAP server
$soapServer = new SOAP_Server();
$dilpsSoap = new DilpsSoapServer(!$config['utf8']);
$soapServer->addObjectMap($dilpsSoap, 'urn:DILPSQuery');

// Service the request
$status = $soapServer->service($GLOBALS['HTTP_RAW_POST_DATA']);
if (is_a($status, 'SOAP_Fault')) {
    $fault = $response->getFault();
    //mail('*****@*****.**', 'soapserverFault', var_export($fault));
}
?>
Exemplo n.º 13
0
            return new SOAP_Fault($errorMsg, 'Client');
        } else {
            $monthname = date('F Y', $Month->getTimeStamp());
            $days = array();
            $Month->build();
            while ($Day =& $Month->fetch()) {
                $day = array('isFirst' => (int) $Day->isFirst(), 'isLast' => (int) $Day->isLast(), 'isEmpty' => (int) $Day->isEmpty(), 'day' => (int) $Day->thisDay());
                $days[] = $day;
            }
            return array('monthname' => $monthname, 'days' => $days);
        }
    }
}
$server = new SOAP_Server();
$server->_auto_translation = true;
$calendar = new Calendar_Server();
$server->addObjectMap($calendar, 'urn:PEAR_SOAP_Calendar');
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
    $server->service($GLOBALS['HTTP_RAW_POST_DATA']);
} else {
    require_once 'SOAP' . DIRECTORY_SEPARATOR . 'Disco.php';
    $disco = new SOAP_DISCO_Server($server, "PEAR_SOAP_Calendar");
    if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
        header("Content-type: text/xml");
        echo $disco->getWSDL();
    } else {
        echo 'This is a PEAR::SOAP Calendar Server. For client try <a href="8.php">here</a><br />';
        echo 'For WSDL try <a href="?wsdl">here</a>';
    }
    exit;
}
Exemplo n.º 14
0
 /**
  * This runs the web service
  *
  * @static
  * @access public
  */
 function run()
 {
     if (defined('JSON_WEBSERVICE')) {
         $this->runJSON();
         return;
     }
     ob_start();
     $server = new SOAP_Server();
     $server->addObjectMap($this, 'http://schemas.xmlsoap.org/soap/envelope/');
     $request = 'Not Set';
     if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
         $request = file_get_contents("php://input");
         $server->service($request);
     } else {
         // Create the DISCO server
         $disco = new SOAP_DISCO_Server($server, $this->namespace);
         header("Content-type: text/xml");
         if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
             echo $disco->getWSDL();
         } else {
             echo $disco->getDISCO();
         }
     }
     $capture = ob_get_flush();
     $this->debug($request, 'request', 5);
     $this->debug($capture, 'response', 5);
     global $_KT_starttime;
     $time = number_format(KTUtil::getBenchmarkTime() - $_KT_starttime, 2);
     $this->debug($time, 'time from start', 4);
 }
Exemplo n.º 15
0
    {
        return $this->_dometallopdb($metal, $mode, $count, true);
    }
    function _dometallopdb($metal, $mode, $count, $rss = false)
    {
        $count = intval($count);
        if ($count <= 0) {
            trigger_error("Parameter count must be an integer > 0, value sent: {$count}", E_USER_ERROR);
        }
        $result = @getPDBFromMetal($metal, $mode, $count);
        if (is_object($result) && DB::isError($result)) {
            trigger_error($result->getMessage(), E_USER_ERROR);
        } elseif ($result == false) {
            trigger_error('No results were found', E_USER_WARNING);
        } else {
            if ($rss) {
                $pkt = toRSS(&$result);
                return new SOAP_Value('result', 'base64', base64_encode($pkt));
            } else {
                return new SOAP_Value('result', 'Struct', $result);
            }
        }
    }
}
$server = new SOAP_Server();
$mdb_services = new MDB_SOAP_Services($ns);
$server->addObjectMap($mdb_services);
$server->service($HTTP_RAW_POST_DATA);
?>