note 105448 added to class.soapserver
| From: | php1221 at klox dot net | Date: | Thu, 18 Aug 2011 20:39:13 +0000 |
| Subject: | note 105448 added to class.soapserver | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182577@lists.php.net to get a copy of this message | ||
While there are plenty of mentions online that SoapServer doesn't support SOAP Headers, this
isn't true.
In your class, if you declare a function with the name of the header, the function will be called
when that header is received.
<?php
class MySoapService {
private $user_is_valid;
function MyHeader($header) {
if ((isset($header->Username)) && (isset($header->Password))) {
if (ValidateUser($header->Username, $header->Password)) {
$user_is_valid = true;
}
}
}
funstion MySoapRequest($request) {
if ($user_is_valid) {
// process request
}
else {
throw new MyFault("MySoapRequest", "User not valid.");
}
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 184.191.162.228
----
Manual Page -- http://www.php.net/manual/en/class.soapserver.php
Edit -- https://master.php.net/note/edit/105448
Del: integrated -- https://master.php.net/note/delete/105448/integrated
Del: useless -- https://master.php.net/note/delete/105448/useless
Del: bad code -- https://master.php.net/note/delete/105448/bad+code
Del: spam -- https://master.php.net/note/delete/105448/spam
Del: non-english -- https://master.php.net/note/delete/105448/non-english
Del: in docs -- https://master.php.net/note/delete/105448/in+docs
Del: other reasons-- https://master.php.net/note/delete/105448
Reject -- https://master.php.net/note/reject/105448
Search -- https://master.php.net/manage/user-notes.php