I'm trying to create custom header using PHP SOAP CLient which will looks like
<soap:Header>
<AuthorizationToken xmlns="http://www.avectra.com/OnDemand/2005/">
<Token>string</Token>
</AuthorizationToken> </soap:Header>
My code looks like:
$client = new SoapClient("http://nftpsandbox.avectra.com/xweb/netFORUMXMLONDemand.asmx?WSDL",array("trace" => 1));
try {
$header = new SoapHeader('http://www.avectra.com/OnDemand/2005/', 'AuthorizationToken', $token, false);
$client->__setSoapHeaders(array($header));
$result = $client->CheckEWebUser(array('szEmail' => $userName , 'szPassword' => $password));
}
catch (SoapFault $result)
{
echo $result->faultstring;
}
catch (Exception $result){
}
But Request header which I'm getting looks like:
<SOAP-ENV:Header>
<ns1:AuthorizationToken>
<ns1:Token></ns1:Token>
</ns1:AuthorizationToken>
</SOAP-ENV:Header>
Any idea why node Token is empty when $token
has a value?
var_dump
on$token
before creating soapheader? – dev-null-dweller Nov 14 '11 at 21:30