downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SoapHeader::__construct> <SoapFault::__toString
[edit] Last updated: Fri, 10 Feb 2012

view this page in

The SoapHeader class

(No version information available, might only be in SVN)

Wstęp

Represents a SOAP header.

Krótki opis klasy

SoapHeader {
/* Metody */
__construct ( string $namespace , string $name [, mixed $data [, bool $mustunderstand [, string $actor ]]] )
SoapHeader ( string $namespace , string $name [, mixed $data [, bool $mustunderstand = false [, string $actor ]]] )
}

Spis treści



add a note add a note User Contributed Notes SoapHeader
jstilow at mobileobjects dot de 10-Oct-2011 07:03
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:

<?php
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

 
show source | credits | stats | sitemap | contact | advertising | mirror sites