Re: [SOAP] ext/soap handing of header params
| From: | Adam Maccabee Trachtenberg | Date: | Fri, 18 Mar 2005 17:29:33 +0000 |
| Subject: | Re: [SOAP] ext/soap handing of header params | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-1771@lists.php.net to get a copy of this message | ||
On Fri, 18 Mar 2005, George Schlossnagle wrote:
> these binding.operation.input.header blocks are currently
> a) entering the proxy classes call prototype
> b) not being put into the actual soap envelope as headers but as body
> nodes.
>
> This is clearly broken. As I see it one of two things need to occur:
>
> a) drop the header params from the proxy class's method prototype and
> require they be set by hand. (ick, imho)
> b) have php correctly integrate them into the request as headers.
I would prefer (b). I do a lot of (a) right now, which I don't like
because it's, well, ick.
The one redeeming quality is that once I've built up the header, I can
stash it someplace and ignore it. What I dislike is that I can no
longer use the overloaded method syntax (because there's no way to set
headers, only parameters), so I'm forced to do:
$user = $client->__soapCall('GetUser', array($params), NULL, $header);
Instead of:
$user = $client->GetUser($params);
(I think I can probably work around this by subclassing SOAPClient and
doing some __call() magic of my own, but it's not the best solution, IMHO.)
In my ideal world, I would be able to do something like:
$client = new SOAPClient('foo.wsdl');
$client->__setHeaders($headers);
$client->GetUser($params);
I think trying to have ext/soap figure out what values are SOAP
headers and what are SOAP parameters may require a little too much
magic. (And what happens when a header and a parameter have the same
name?)
Also, I generally find I set the headers once per client and then make
multiple client calls without modifying them, so a "set it once and
forget it" method works best in this situation.
How does this sync up with what you're thinking?
-adam
PS: Dimity @ Zend does almost all of the ext/soap work, but I never
see him on this list.
--
adam@trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!