UFT API Test: Sign SOAP request and Security configuration failure
I've struggled for this 2 weeks. Any one have any idea on it?
-The web service wsdl is ready and test cases can be executed successfully in SoapUI pro.
-For security certificate, in SoapUI, it supports .jks file.
-The goal is to convert the test from SoapUI to HP UFT API Test
Windows 8.1 Enterprise
SoapUI Pro 5.1.2 and NG 1.4.1
[Steps to reproduce]
Same wsdl and test want to convert to HP UFT API Testing.
- I use “SoapUI to API test converter” from UFT 12.02 to generate test cases to UFT version. Open one test case, which only contains one request.
- I have the .p12 file (Converted from .jks) and also is applied to my windows 8 workstation as windows store.
- After conversion, only “serviceContext” and “Action” properties are converted.
- I created one “MessageID” property and using beforeExecuteStepEvent to generate uuid
public void StServiceCallActivity4_OnBeforeExecuteStepEvent(object sender, STActivityBaseEventArgs args)
Guid uuid = Guid.NewGuid();
this.StServiceCallActivity4.InputEnvelope.SelectSingleNode("//*[local-name(.)='MessageID']").InnerText = "uuid:"+uuid;
- Set the “Security setting”
- In “WS Addressing” section, there is no 200508 version supported as we required. Here I have tried both “None” and “WSA 04/08”.
- In WS-Security tab, create “UserName Token”, there is no “PasswordDigest” password type as our request. I have tried both “Text” and “Hash”.
- Create the “X509 certificate Token” and invoke the .p12 file. The reference type is: “BinarySecurityToken”
Create and sign the 6 WSS entries (same as ‘parts’ in SoapUI) with MessageSignature. I tried multiple ways.
- Choose all Predefined parts and leave xPath empty
- Change another algorithm
- Appling wsa and xpath for ‘serviceContext” which is not predefined parts
- Using xpath matching the body with special namespace
Execute the test. It failed to sign (encrypted) the Soap request data with error.
I'd like to send more detail if someone need.