In a previous post (Link), I described how to create a BizTalk send port that uses a client certificate and WS-Security (Message security with username/password) .In this post, I will explain how you can set up a test project in SoapUI that calls this service.
Add the SOAP project to SoapUI as you would normally do. Then double click on the projectname. You will get a screen with a tab named WS-Security Configurations. Within this tab, you see a subtab KeySores. SoapUI is a Java tool and therefore has no access to the certificate store. That’s why we have to add the client certificate to a keystore. Add the client certificate (pfx file) along with the private key password to the keystore. Because we use this certificate for client authentication, we actually need the certificate with private key.
Next, go to tab Outgoing WS-Security Configurations. In the upper section add a name for the configuration, i.e. Stadgenoot2WoningNet.Click on this configuration name and click the plus sign on the lower section to add a UserName WSS entry.
Now open the request and go to the properties. Set property SSL KeyStore to the name of the key store (or client certificate) just added.
If you now send the request and go to the raw view, you will see a wsse:Security header is added, just like you want. The service will return a result.
<soapenv:Header> <wsse:Security 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=”UsernameToken-1F491E6A43CA3B6C9F15040943150521″> <wsse:Username>STADGENOOT.KEY2WOCAS</wsse:Username> <wsse:Password Type=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText”>3d6z572MfFj3hYubFX7ojotGZjWk1Gmy</wsse:Password> <wsse:Nonce EncodingType=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary”>CczzqmA7DePOyPI1YZ3coA==</wsse:Nonce> <wsu:Created>2017-08-30T11:58:35.051Z</wsu:Created> </wsse:UsernameToken> </wsse:Security></soapenv:Header>
Further reading: SoapUI.org