note 49151 added to function.soap-soapheader-construct

From: Date: Tue, 18 Jan 2005 11:02:16 +0000
Subject: note 49151 added to function.soap-soapheader-construct
Groups: php.notes 
Request: Send a blank email to php-notes+get-83547@lists.php.net to get a copy of this message
If you are trying to create a header like this: <SOAP-ENV:Header> <ns2:authenticate SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next"> <username>myuser</username> <password>secret</password> </ns2:authenticate> </SOAP-ENV:Header> Try to use a class to create Header-vars: class authentication_header { private $username; private $password; public function __construct($username,$password) { $this->username=$username; $this->password=$password; } } In your soap client program: // generate new object $auth=new authentication_header('myuser','secret'); // create authentication header values $authvalues=new SoapVar($auth,SOAP_ENC_OBJECT,'authenticate'); // generate header $header=new SoapHeader("myURN", "authenticate", $authvalues, false, "http://schemas.xmlsoap.org/soap/actor/next"); And do the request like this (non-WSDL version): $client->__call('function', $params, null, $header); Have fun, Nils Sowen ---- Manual Page -- http://www.php.net/manual/en/function.soap-soapheader-construct.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49151 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49151&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49151&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49151&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49151&report=yes&reason=useless+example Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49151&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49151&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#83547) next »