WsdlToPhp/WsSecurity

Problem using the framework

Closed this issue · 6 comments

Hello, I'm not being able to apply wsdlphp to my code. I need to create a Header exactly like this:

<soapenv:Header>
 <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-
wss-wssecurity-utility-1.0.xsd">
  <wsu:Timestamp wsu:Id="TS-32E6B34377D7E4A58614607283662392">
   <wsu:Created>xxxx</wsu:Created>
   <wsu:Expires>xxxxx</wsu:Expires>
  </wsu:Timestamp>
  <wsse:UsernameToken wsu:Id="UsernameToken32E6B34377D7E4A58614607283662221">
   <wsse:Username>xxxx</wsse:Username>
   <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis200401-wss-username-token-profile-1.0#PasswordDigest">xxxxx</wsse:Password>
   <wsse:Nonce EncodingType="http://docs.oasisopen.org/wss/2004/01/oasis-200401-wss-soap-message-security1.0#Base64Binary">xxxxxxx</wsse:Nonce>
   <wsu:Created>xxxxxx</wsu:Created>
  </wsse:UsernameToken>
 </wsse:Security>
</soapenv:Header>

You can help me, thanks.

Can you paste the portion of code you're using to set the header?

In addition, paste what is generated on your side and indicate what is missing exactly, thanks.

mikaelcom,

Thank you for contacting us. I discovered the problem, I am using the latest version 2.0.2 and it requires the correct PHP 7.4 ^. On my server I have PHP 7.3 at most. How do I use version 1.2.2? Does it work too? Why with localhost is working perfectly with version 2.0.2

I appreciate the help

If you're using composer, use composer req wsdltophp/wssecurity:~1.0 so you'll end up with WsSecurity 1.2.2.

I can't say for localhost unless your localhost is using PHP >= 7.4?

Yes, on localhost I use PHP 7.4.
However, my Web server supports up to 7.3.
I will use version 1.2.2 and see if I am successful. For now I thank you.

It worked perfectly with version 1.2.2. Thank you