RE: [PHP-DEV] Enchancement in SoapServer::handle method
| From: | Christian Stoller | Date: | Tue, 29 Oct 2013 12:30:30 +0000 |
| Subject: | RE: [PHP-DEV] Enchancement in SoapServer::handle method | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69939@lists.php.net to get a copy of this message | ||
> From: krzysztof karasek [mailto:karasek.krzysztof@gmail.com]
>
> Hi there,
>
> I'm not member of the PHP community, but ...
> I have a proposal to add one new optional boolean paramter for
> SoapServer::handle method.
> to allow control whether result is sent directly to output (true) or to
> string (false).
> Default value should be always true for backward compatibility.
>
> This small change will allow to enchance SoapServer implementation and add
> support for attachements. I tested it with PHP 5.3, 5.4 and it works great
> for me. Now I use it in all my PHP compilations.
>
Hi Krzysztof,
I am not sure whether I understand you correctly, but couldn't you use
ob_start()and ob_get_clean() to get the output of SoapServer::handle() as
string.
Here's an example:
class SWASOAPServer extends SoapServer
{
public function handle($input, $toOutput = false){
ob_start();
parent::handle($input);
$result = ob_get_clean();
// now do something with the output
}
}