2 SOAP Typemap 3: SoapClient support for typemap's from_xml()
4 <?php require_once('skipif.inc'); ?>
5 <?php if (!extension_loaded('simplexml')) die("skip simplexml extension not available"); ?>
7 soap.wsdl_cache_enabled=0
10 class TestSoapClient extends SoapClient{
11 function __doRequest($request, $location, $action, $version, $one_way = 0) {
13 <?xml version="1.0" encoding="UTF-8"?>
14 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.nothing.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body>
15 <ns1:dotest2Response><res xsi:type="ns1:book">
16 <a xsi:type="xsd:string">foo</a>
17 <b xsi:type="xsd:string">bar</b>
19 </ns1:dotest2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
30 function book_from_xml($xml) {
31 $sxe = simplexml_load_string($xml);
33 $obj->a = (string)$sxe->a;
34 $obj->b = (string)$sxe->b;
39 'actor' =>'http://schemas.nothing.com',
40 'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
41 "type_name" => "book",
42 "from_xml" => "book_from_xml"))
45 $client = new TestSoapClient(dirname(__FILE__)."/classmap.wsdl",$options);
46 $ret = $client->dotest2("???");