I am getting a request in the following method but the soap message does not appear to contain the UsernameToken Element:
$policy = new WSPolicy(
array(
'useUsernameToken'=>true
)
);
$security = new WSSecurityToken(
array(
'user'=>$username,
'passwordType'=>'PlainText',
'password'=>$password
)
);
// create client in WSDL mode
$client = new WSClient(
array (
'wsdl'=>$service_wsdl,
'to'=>$service_url,
'policy'=>$policy,
'securityToken'=>$security,
'trace'=>1
)
);
$proxy = $client->getProxy();
$proxy->Ping();
The request that is produced looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ns1:Ping xmlns:ns1="http://streamlinedsalestax.org/efile"/>
</soapenv:Body>
</soapenv:Envelope>
You'll notice that the UsernameToken element is completely missing.