예제 #1
0
function serializationAction(&$body)
{
    //Take the raw response
    $rawResponse =& $body->getResults();
    error_log("[SWX] INFO Method call result = {$rawResponse}");
    adapterMap($rawResponse);
    $swxAssembler = null;
    $defaultFormat = 'as2';
    if (isset($_POST['format'])) {
        $defaultFormat = $_POST['format'];
    } elseif (isset($_GET['format'])) {
        $defaultFormat = $_GET['format'];
    }
    error_log('encoding with ' . $defaultFormat);
    if ($defaultFormat == 'as3') {
        require_once SWX_BASE . 'SwxAssembler3.php';
        $swxAssembler = new SwxAssembler3();
    } else {
        require_once SWX_BASE . 'SwxAssembler.php';
        $swxAssembler = new SwxAssembler();
    }
    ob_start();
    $swxAssembler->writeSwf($rawResponse, $GLOBALS['swx']['debug'], 4, $GLOBALS['swx']['url']);
    $rawResponse = ob_get_contents();
    ob_end_clean();
    $body->setResults($rawResponse);
}
예제 #2
0
function serializationAction(&$body)
{
    //Take the raw response
    $rawResponse =& $body->getResults();
    adapterMap($rawResponse);
    //Now serialize it
    $encodedResponse = json_encode($rawResponse);
    if (count(NetDebug::getTraceStack()) > 0) {
        $trace = "/*" . implode("\n", NetDebug::getTraceStack()) . "*/";
        $encodedResponse = $trace . "\n" . $encodedResponse;
    }
    $body->setResults($encodedResponse);
}