File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
soap /
tests /
typemap012.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:01 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
SOAP Typemap 12: SoapClient support for typemap's to_xml() (SoapFault)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--INI--
soap.wsdl_cache_enabled=0
--FILE--
<?php
class TestSoapClient extends SoapClient{
function __doRequest($request, $location, $action, $version, $one_way = 0) {
echo $request;
exit;
}
}
class book{
public $a="a";
public $b="c";
}
function book_to_xml($book) {
throw new SoapFault("Client", "Conversion Error");
}
$options=Array(
'actor' =>'http://schemas.nothing.com',
'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
"type_name" => "book",
"to_xml" => "book_to_xml"))
);
$client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
$book = new book();
$book->a = "foo";
$book->b = "bar";
try {
$ret = $client->dotest($book);
} catch (SoapFault $e) {
$ret = "SoapFault = " . $e->faultcode . " - " . $e->faultstring;
}
var_dump($ret);
echo "ok\n";
?>
--EXPECT--
string(37) "SoapFault = Client - Conversion Error"
ok
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>