我在使用自定义soap标头与
PHP5一起工作时遇到问题.请有人指导我.
我需要的是这样的
myusername
mypassword
我得到的是:
myusername
mypassword
我想删除命名空间标记.
我用来获得这个的代码是:
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/',"null",$authvalues);
Null似乎没有传递..使用’null’我仍然得到名称空间,如第二个例子..如何排除这个NS …感谢你的帮助提前..
$headers = array();
$headers[] = new SoapHeader(null, 'USER', $username);
$headers[] = new SoapHeader(null, 'PASSWORD', $password);
$client->__setSoapHeaders($headers);
try {
$result = $client->getAvailableLicensedDNCount('ASX01');
print_r($result);
Fatal error: SoapHeader::SoapHeader(): Invalid parameters. Invalid namespace. in /usr/home/deepesh/SoapCalls/deepesh7.php on line 29