|
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
[Back to original message]
|