I am new to SOAPUI. So far; I have created the default WCF project in Visual Studio; published it to IIS and then tested it in SOAPUI. This worked as expected.
I am now trying to test a simple WCF Service, which uses Basic Authentication. I can test this WCF Service (with Basic Authentication) in a C# program as follows (this works as expected):
ServiceReference1.Service1Client s1 = new ServiceReference1.Service1Client();
s1.ClientCredentials.UserName.UserName = "testuser";
s1.ClientCredentials.UserName.Password = "testpassword";
string str = s1.GetData(1);
I have spent a long time trying to get the Auth window to work.
Instead I have done this, which works:
1.In the Request window, select the “Headers” tab on the bottom left.
2.Click the “+” button to add a header. The name of the header must be “Authorization.” Click OK.
3.In the value box, enter the word “Basic” plus the base64-encoded username:password. Use a base 64 encoder/decoder tool to create the base64 user:password string. For example, the Base64 version of “testuser:testpwd” is “dGVzdHVzZXI6dGVzdHB3ZA==” so the Value for the header would be Basic dGVzdHVzZXI6dGVzdHB3ZA==
Here is a base64 encoder I used: https://www.base64encode.org/