Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * This file contains the code for a local transport layer for testing
4
 * purposes.
5
 *
6
 * PHP versions 4 and 5
7
 *
8
 * LICENSE: This source file is subject to version 2.02 of the PHP license,
9
 * that is bundled with this package in the file LICENSE, and is available at
10
 * through the world-wide-web at http://www.php.net/license/2_02.txt.  If you
11
 * did not receive a copy of the PHP license and are unable to obtain it
12
 * through the world-wide-web, please send a note to license@php.net so we can
13
 * mail you a copy immediately.
14
 *
15
 * @category   Web Services
16
 * @package    SOAP
17
 * @author     Jan Schneider <jan@horde.org>
18
 * @copyright  2008 The PHP Group
19
 * @license    http://www.php.net/license/2_02.txt  PHP License 2.02
20
 * @link       http://pear.php.net/package/SOAP
21
 */
22
 
23
require_once 'SOAP/Transport.php';
24
 
25
/**
26
 * Test transport for SOAP.
27
 *
28
 * @access  public
29
 * @package SOAP
30
 * @author  Jan Schneider <jan@horde.org>
31
 */
32
class SOAP_Transport_TEST extends SOAP_Transport
33
{
34
    /**
35
     * Sends and receives SOAP data.
36
     *
37
     * @param string $msg     Outgoing SOAP data.
38
     * @param array $options  Options.
39
     *
40
     * @return string|SOAP_Fault
41
     */
42
    function send($msg, $options = array())
43
    {
44
        $_SERVER['REQUEST_METHOD'] = 'POST';
45
        $this->outgoing_payload = $msg;
46
        ob_start();
47
        $server = clone($options['server']);
48
        $server->service($msg);
49
        $this->incoming_payload = ob_get_contents();
50
        ob_end_clean();
51
        return $this->incoming_payload;
52
    }
53
 
54
}