note 100176 deleted from book.soap by danbrown
| From: | danbrown@php.net | Date: | Wed, 29 Sep 2010 16:58:02 +0000 |
| Subject: | note 100176 deleted from book.soap by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172811@lists.php.net to get a copy of this message | ||
Note Submitter: php_engineer_bk at yahoo dot com
----
server file
<?php
function GetValue()
{
$literalObjectDeclared = (object) array(
'foo' => (object) array(
'bar' => 'baz',
'pax' => 'vax'
),
'moo' => 'ui'
);
return $literalObjectDeclared;
}
ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
$server = new SoapServer("service.wsdl");
$server->addFunction("GetValue");
$server->handle();
?>
client file
<?php
$Client = new SoapClient("http://localhost/wsdl/service.wsdl?wsdl");
$obj = $Client->__call('GetValue', array(""));
echo $obj->foo->bar;
?>
Iranian php programming (farhad zandmoghadam)