Annotation of embedaddon/php/ext/soap/tests/transport001.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: SOAP Transport 1: Local transport using SoapClient::__doRequest
                      3: --SKIPIF--
                      4: <?php require_once('skipif.inc'); ?>
                      5: --FILE--
                      6: <?php
                      7: function Add($x,$y) {
                      8:   return $x+$y;
                      9: }
                     10: 
                     11: class LocalSoapClient extends SoapClient {
                     12: 
                     13:   function __construct($wsdl, $options) {
                     14:     parent::__construct($wsdl, $options);
                     15:     $this->server = new SoapServer($wsdl, $options);
                     16:     $this->server->addFunction('Add');
                     17:   }
                     18: 
                     19:   function __doRequest($request, $location, $action, $version, $one_way = 0) {
                     20:     ob_start();
                     21:     $this->server->handle($request);
                     22:     $response = ob_get_contents();
                     23:     ob_end_clean();
                     24:     return $response;
                     25:   }
                     26: 
                     27: }
                     28: 
                     29: $x = new LocalSoapClient(NULL,array('location'=>'test://', 
                     30:                                    'uri'=>'http://testuri.org')); 
                     31: var_dump($x->Add(3,4));
                     32: echo "ok\n";
                     33: ?>
                     34: --EXPECT--
                     35: int(7)
                     36: ok

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