soap - Advantage of PHP SoapClient classmap -
can tell me advantage of using classmap option within php soapclient? maybe practical examples?
the classmap option can used map wsdl types php classes.
example,
class myloginresult { protected $serverurl; protected $sessionid; public function getserverurl() { return $this->serverurl; } public function getsessionid() { return $this->sessionid; } public function getserverinstance() { $match = preg_match( '/https:\/\/(?<instance>[^-]+)\.example\.com/', $this->serverurl, $matches ); return $matches['instance']; } } $client = new soapclient("books.wsdl", array('classmap' => array('loginresult' => "myloginresult"))); $loginresult = $client->getloginresult(); $instance = $loginresult->getserverinstance();
Comments
Post a Comment