Re: [SOAP] Accessing SOAP Headers
| From: | Alex Stansfield | Date: | Tue, 12 Apr 2005 09:13:39 +0000 |
| Subject: | Re: [SOAP] Accessing SOAP Headers | ||
| References: | 1 2 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-1849@lists.php.net to get a copy of this message | ||
Hi,
> Server PHP Code:
>
> function requiredHeader($h) {
> // do something with the header
> // store result in $GLOBALS array
> }
>
> function echoHeader() {
> // pull result from $GLOABLS array
> }
>
> $s = new SOAPServer('my.wsdl');
> $s->addFunction('requiredHeader');
> $s->addFunction('echoHeader');
> $s->handle();
I spotted this code before but it just confused me. Does this mean I
actually need to call the "requiredHeader" function from the soap client
in order to tell the server to read the header?
I was hoping for something more along the lines where if the server
receives a SOAP message with a header it was automatically extracted. So
if I called a "ApplicationRequest($appid)" from the client the
ApplicationRequest function on the server would have access
automatically to whatever headers were supplied in the request.
So far all the PHP soap I've done has been pretty easy and straight
forward, I was hoping the headers would be no different. Is there
something I'm missing here in my understanding of the situation?
Cheers,
Alex