You are here: PHP 5 soap and XML custom soap header « PHP Programming Language « IT news, forums, messages
PHP 5 soap and XML custom soap header

Posted by Matthew Harvey on 09/15/05 13:46

Hello,
I am having a problem getting a custom soap header to work with PHP5.
What I require is something like this:
<SOAP-ENV:Header>
<USER>myusername</USER>
<PASSWORD>mypassword</PASSWORD>
</SOAP-ENV:Header>

What I get is :
<SOAP-ENV:Header>
<ns2:auth>
<USER>myusername</USER>
<PASSWORD>mypassword</PASSWORD>
</ns2:auth>
</SOAP-ENV:Header>

I would like to remove the namespace tags.
The code I use to get this is:
class Authstuff {
public $USER;
public $PASSWORD;
public function __construct($user, $pass) {
$this->USER = $user;
$this->PASSWORD = $pass;
}
}

$auth = new Authstuff('myusername', 'mypassword');
$param = array('Authstuff' => $auth);
$authvalues = new SoapVar($auth,SOAP_ENC_OBJECT);
$header = new
SoapHeader('http://soapinterop.org/echoheader/',auth,$authvalues);


I have tried several other ways to do this but to no avail, using a
"null" in the namespace field returns an error.
Any help on how to do this would be great. Also could anyone recommend
a programmer for hire to help out on these problems as I will be having
quite a few in the comming weeks, not on a full time basis but to help
out with this type of question(s).

Cheers,
Harv

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация