Forum Discussion

insurteched's avatar
insurteched
New Contributor
8 months ago
Solved

SoapUI WSDL call to PHP (curl or SoapClient)

Hello. I have a SoapUI call with username and password that works correctly in SoapUI (when I set password type to PasswordDigest in SoapUI properties). I now need to get this working on a server. M...
  • Humashankar's avatar
    5 months ago

    Hi insurteched​ 

    The issue you're facing sounds from PHP's native SoapClient lacking native support for generating WS-Security UsernameToken headers with PasswordDigest, Nonce, and Timestamp, which is a format SoapUI can produce when configured accordingly.

    • Seems your PHP code fails to generate the required WS-Security header format, leading to the [ns1:InvalidSecurity] error.
    • This discrepancy arises because SoapUI can automatically generate WS-Security headers when configured, whereas PHP SoapClient only supports basic HTTP authentication and lacks built-in support for WS-Security UsernameToken with PasswordDigest.

    Consider using a PHP library that supports WS-Security, such as robrichards/wse-php, which can help generate the required WS-Security headers.

    Use a library such as robrichards/wse-php to generate the correct WS-Security headers in PHP. This will allow your PHP server-side code to authenticate successfully with services that require UsernameToken with PasswordDigest, Nonce, and Timestamp—matching what SoapUI produces78.

    To learn more - WS-Security (WSS) for API Testing | SoapUI\

    Hope this helps - Happy to help further!!
    Thank you very much and have a great one!
    Warm regards