Forum Discussion

insurteched's avatar
insurteched
New Contributor
2 months ago

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. My preferred choice is PHP.

I get the following error in my __soapCall: SoapFault exception: [ns1:InvalidSecurity] An error was discovered processing the <wsse:Security> header

I have tried:

  • exporting to postman and getting the code from there (the username and password disappear during the import)
  • using PHP's Curl for the call
  • using PHP's new SoapClient

I cannot get passed the sse security. I tried the following with and without nonce:

$wsseHeader = <<<XML
<wsse:Security xmlns:wsse=$namespace>
    <wsse:UsernameToken>
        <wsse:Username>your_username</wsse:Username>
        <wsse:Password Type="wsse:PasswordDigest">$passwordDigest</wsse:Password>
        <wsse:Nonce EncodingType="wsse:Base64Binary">$nonce</wsse:Nonce>
        <wsu:Created xmlns:wsu="http://schemas.xmlsoap.org/ws/2003/06/utility">$timestamp</wsu:Created>
    </wsse:UsernameToken>
</wsse:Security>
XML;

I have literally tried hundreds of permutations. and read so many blog posts on the matter that have ended up chasing my tail. What am I missing?

Alternatively, can anyone recommend a better way of deploying the soapUI call on a server?

Thanks

No RepliesBe the first to reply