diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/soap/tests/typemap010.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/soap/tests/typemap010.phpt')
-rw-r--r-- | ext/soap/tests/typemap010.phpt | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/ext/soap/tests/typemap010.phpt b/ext/soap/tests/typemap010.phpt new file mode 100644 index 0000000..4eba634 --- /dev/null +++ b/ext/soap/tests/typemap010.phpt @@ -0,0 +1,58 @@ +--TEST-- +SOAP typemap 10: SoapServer support for typemap's to_xml() (SoapFault) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- +<?php +$GLOBALS['HTTP_RAW_POST_DATA']=" +<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" + xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" + xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" + xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\" + xmlns:ns1=\"http://schemas.nothing.com\" +> + <env:Body> +<ns1:dotest2> +<dotest2 xsi:type=\"xsd:string\">???</dotest2> +</ns1:dotest2> + </env:Body> +<env:Header/> +</env:Envelope>"; + +function book_to_xml($book) { + throw new SoapFault("Server", "Conversion Fault"); +} + +class test{ + function dotest2($str){ + $book = new book; + $book->a = "foo"; + $book->b = "bar"; + return $book; + } +} + +class book{ + public $a="a"; + public $b="c"; + +} + +$options=Array( + 'actor' =>'http://schemas.nothing.com', + 'typemap' => array(array("type_ns" => "http://schemas.nothing.com", + "type_name" => "book", + "to_xml" => "book_to_xml")) + ); + +$server = new SoapServer(dirname(__FILE__)."/classmap.wsdl",$options); +$server->setClass("test"); +$server->handle($HTTP_RAW_POST_DATA); +echo "ok\n"; +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Conversion Fault</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> +ok |