note 106101 added to class.soapheader
| From: | jstilow at mobileobjects dot de | Date: | Mon, 10 Oct 2011 14:03:17 +0000 |
| Subject: | note 106101 added to class.soapheader | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183765@lists.php.net to get a copy of this message | ||
It cost me some time to figure out how to add a SoapHeader to a server response. For me the
following solution works well enough:
class SoapService {
private $server = null;
public function __construct($server)
{
$this->server = $server;
}
public function soap($request) {
// do something useful
// These are the two "magic" lines:
$header = new SoapHeader("namespace", "name", new HeaderClass("possible
some parameters"));
$this->soap_server->addSoapHeader($header);
// do more useful stuff
}
}
$soap_server = new SoapServer("./your.wsdl");
$soap_server->setClass("SoapService", $soap_server);
$soap_server->handle();
See also:
https://bugs.php.net/bug.php?id=32410
----
Server IP: 69.147.83.197
Probable Submitter: 80.66.21.250
----
Manual Page -- http://www.php.net/manual/en/class.soapheader.php
Edit -- https://master.php.net/note/edit/106101
Del: integrated -- https://master.php.net/note/delete/106101/integrated
Del: useless -- https://master.php.net/note/delete/106101/useless
Del: bad code -- https://master.php.net/note/delete/106101/bad+code
Del: spam -- https://master.php.net/note/delete/106101/spam
Del: non-english -- https://master.php.net/note/delete/106101/non-english
Del: in docs -- https://master.php.net/note/delete/106101/in+docs
Del: other reasons-- https://master.php.net/note/delete/106101
Reject -- https://master.php.net/note/reject/106101
Search -- https://master.php.net/manage/user-notes.php