Forum Discussion

ahart's avatar
ahart
Occasional Contributor
10 years ago

Project that works in SoapUi 4.6.1 fails in SoapUi

I have a SoapUi project from 4.6.1 that uses WS-Security to connect to a Apache CXF 2.3.1/JBoss6 SOAP web service.

 

The SSL global preferences are set with a certificate that gets through our proxy, then the WS-Security configuration references a keystore containing the same SSL certificate and a truststore with the public key of the server.

 

The requests must be timestamped and signed.  The responses are timestamped, signed (the timestamp Content and the Body element), and encrypted (Body content).

 

In SoapUi 5.2, when I load this project and submit a request, I get back an 200 response and then an error message that says "Error getting response for ... ;null"

 

In the http log I see the headers of the response and then what looks like the entire response encrypted.  I see no errors in the "error log".

 

For grins, I went into the WS-Security "incoming" configuration and flipped the values for the decrypt and signature keystores around,  my client.jks and client-truststore.jks, respectively.

 

When I did that, I no longer got a "null" response, I see the Soap envelope, but the soap:Body contains a <xenc: EncryptedData" element.  I also get a WSSecurityException in the error log saying that "The signature or decyrption was invalid".  The root cause is:

 

   Caused by: org.apache.ws.security.WSSecurityException: The keystore is null
    at org.apache.ws.security.components.crypto.Merlin.getPrivateKey(Merlin.java:639)
    at org.apache.ws.security.processor.EncryptedKeyProcessor.handleToken(EncryptedKeyProcessor.java:141)

 

So, obviously, something has changed in the way I should be configuring SoapUi.  The last go around with SoapUi 4.6.1, it seemed to take forever before I settled on a WS-Security configuration that worked.

 

Any suggestions?

 

Thanks.

  • rupert_anderson's avatar
    rupert_anderson
    Valued Contributor

    Hi,

     

    I have seen similar issues those you are describing, perhaps since version 5.0. The signature and timestamp functionity seems to work ok, but the encrytion causes that null response - I think its to do with the WSS4j related libraries that SoapUI bundles, and is in fact a confusing, but hopefully quite easily fixed bug. This post relates to the same problem and provides details of a solution by way of copying in the newer / required library version:

     

    http://community.smartbear.com/t5/SoapUI-Open-Source/Incoming-WS-Security-NullPointerException/m-p/9980/highlight/true#M5695

     

    Hope this helps,

    Cheers,

    Rupert

    • ahart's avatar
      ahart
      Occasional Contributor

      Yes, thank you very much.  I suspected it had something to do with a different version of WSS4J, but I would not have been able to quickly pin it down to that jar.

       

      I replaced xmlsec-1.4.5.jar with xmlsec-1.5.8.jar in the SoapUi installation lib folder, and that solved the problem as you described.

       

      I appreciate the help very much.

       

      Regards

      -- Andy

      • rupert_anderson's avatar
        rupert_anderson
        Valued Contributor

        Hi Andy,

         

        You're welcome, am happy to save someone else some time - I remember finding this issue confusing and annoying wondering what the 'null' response actually meant!! :-)

         

        Ideally this issue should be patched in the actual product.

         

        Thanks,

        Rupert