Adding a header to all SOAP requests transparently

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

For each webservice call I need to pass a token in the SOAP envelope header.
This is done using:-

$ourHeader = new SOAP_Header('TokenHeader', 'Struct', array('InnerToken' =>
$this->userToken), false);
$ourHeader->attributes['xmlns'] =
$GLOBALS['g_ps']['MedVisor']['serviceNamespace'];
$this->addHeader($ourHeader);

I would like this code to be automatically added upon each webservice method
call without me having to duplicate code.

So, I've created a class for my custom webservice methods. This new class
extends the SOAP_Client class. All my webservices now extend my custom WS
class.

In the constructor I call the addHeader() above.
This works fine for the first WS call.

If I then call a subsequent webservice method in the same class, the header
is not sent! It seems to get discarded after the first use of
SOAP_Client::call() method.

Is this a bug or have I created my class architecture incorrectly to achieve
what I want to do?

Regards,

-- 
Mike C


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux