SOAP_Header namespace missing
| From: | Mike Carter | Date: | Wed, 09 Apr 2003 12:08:20 +0000 |
| Subject: | SOAP_Header namespace missing | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-534@lists.php.net to get a copy of this message | ||
Hi guys,
First off, sorry if thie has been discussed - is there any plans to get this
list available in searchable archive form on php.net yet? I'm not even sure
if this mailing list is to do with the PEAR:SOAP or the PECL:SOAP
implementation for PHP?
I've got a problem between PHP and a MS .NET webservice. PHP is acting as a
client here, using rhe PEAR::SOAP package.
The .NET webservice server requires a certain value sent in the header of
every SOAP request. I can do this fine using:
$this->addHeader(new SOAP_Header('TokenHeader', 'Struct',
array('InnerToken'
=> $this->userToken), false));
However the .NET webservice is refusing to accept this header because it is
missing an associated namespace attribute in the serialized XML being
produced by the PEAR:SOAP class.
For a test I hardcoded my personal test namespace (xmls) into the
SOAP_Header class constructor:
function SOAP_Header($name = '', $type, $value = NULL,
$mustunderstand = 0,
$actor =
'http://schemas.xmlsoap.org/soap/actor/next'
)
{
parent::SOAP_Value($name, $type, $value);
$this->attributes['SOAP-ENV:actor'] = $actor;
$this->attributes['SOAP-ENV:mustUnderstand'] = (int)$mustunderstand;
$this->attributes['xmlns'] =
"http://www.pma.co.uk/DD01WS/AuthenticationService/";
}
This worked brilliant and the .NET side didn't refuse my web service method
request. However I really do not know how to make the SOAP_Header get the
xmlns attribute dynamically. I talk to a number of different webservices,
in different namespaces, and they all need the special header sending along
with the request.
As I am not totally familiar with the large amount of code in the PEAR:SOAP
pacakge right now (and don't have time to start learning it due to a
deadline at work) I was wondering if anybody has managed to solve this issue
- or knows the code well enough to produce an officail fix for the problem?
Kind regards,
--
Mike Carter [web developer]
tel: 01925 758229 // fax: 01925 758023 // web: www.koa.uk.com
This message is confidential.
Unless you are the named addressee or their delegated representative you may
not use, disclose, or copy the contents of the e-mail. If you are not the
named addressee please notify the sender immediately and delete the material
from your computer. Any views or opinions contained in this e-mail are
solely those of the author unless expressly stated otherwise
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________