I have to use a web service that requeires authentication with ws-security like that:
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="Example-1">
<wsse:Username>MYUSERNAME</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">MYPASSWORD</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">NONCE==</wsse:Nonce>
<wsu:Created>YYYY-MM-DDTHH:MM:SS.000Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
How can I do this kind of authentication with PHP SoapClient?
You have to build it yourself.
See this example https://gist.github.com/silasrm/a57a1e3af165cb43644b712192625a3b
To avoid dead links, I'm posting the code here:
and how to make the call: