source: branches/version-2_12_3/data/module/SOAP/Transport/TEST.php @ 21318

Revision 21318, 1.5 KB checked in by kotani, 15 years ago (diff)

#1521 (PEAR::SOAP 配布と異なる部分がある)

  • 新しいバージョンの配布ファイルを上書きすることで解決

#1522 (PEAR::SOAP をバージョンアップ)

  • 0.11.0 -> 0.12.0
Line 
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 [email protected] so we can
13 * mail you a copy immediately.
14 *
15 * @category   Web Services
16 * @package    SOAP
17 * @author     Jan Schneider <[email protected]>
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
23require_once 'SOAP/Transport.php';
24
25/**
26 * Test transport for SOAP.
27 *
28 * @access  public
29 * @package SOAP
30 * @author  Jan Schneider <[email protected]>
31 */
32class 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}
Note: See TracBrowser for help on using the repository browser.