Annotation of embedaddon/php/ext/soap/tests/typemap012.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: SOAP Typemap 12: SoapClient support for typemap's to_xml() (SoapFault)
        !             3: --SKIPIF--
        !             4: <?php require_once('skipif.inc'); ?>
        !             5: --INI--
        !             6: soap.wsdl_cache_enabled=0
        !             7: --FILE--
        !             8: <?php
        !             9: class TestSoapClient extends SoapClient{
        !            10:   function __doRequest($request, $location, $action, $version, $one_way = 0) {
        !            11:                echo $request;
        !            12:                exit;
        !            13:        }       
        !            14: }
        !            15: 
        !            16: class book{
        !            17:        public $a="a";
        !            18:        public $b="c";
        !            19:                
        !            20: }
        !            21: 
        !            22: function book_to_xml($book) {
        !            23:        throw new SoapFault("Client", "Conversion Error");
        !            24: }
        !            25: 
        !            26: $options=Array(
        !            27:                'actor' =>'http://schemas.nothing.com',
        !            28:                'typemap' => array(array("type_ns"   => "http://schemas.nothing.com",
        !            29:                                         "type_name" => "book",
        !            30:                                         "to_xml"  => "book_to_xml"))
        !            31:                );
        !            32: 
        !            33: $client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
        !            34: $book = new book();
        !            35: $book->a = "foo";
        !            36: $book->b = "bar";
        !            37: try {
        !            38:        $ret = $client->dotest($book);
        !            39: } catch (SoapFault $e) {
        !            40:        $ret = "SoapFault = " . $e->faultcode . " - " . $e->faultstring;
        !            41: }
        !            42: var_dump($ret);
        !            43: echo "ok\n";
        !            44: ?>
        !            45: --EXPECT--
        !            46: string(37) "SoapFault = Client - Conversion Error"
        !            47: ok

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>