I have sent a soap service for which I have to send basic auth (username and password) along with request and header values in qaf. I tried adding username and password in application.properties file but the service is throwing internal server error. Please guide me how can we do it.
Asked
Active
Viewed 264 times
0
-
will you please share your web service request call and exception details as well? – user861594 Jan 11 '19 at 18:15
1 Answers
0
If it is basic authentication you can try providing credential in url, For example: http://user:pwd@url.com
. Other alternate is register client that takes care of authentication using property rest.client.impl
. Few of ready to use implementations are available with qaf-support-ws library. You can try BasicAuthRestClient
as below:
rest.client.impl=com.qmetry.qaf.automation.rest.client.BasicAuthRestClient
rest.client.basic.auth.username=username
rest.client.basic.auth.password=password
This should work for any webservice call regardless of type rest or soap. Keep in mind that in case of soap, method always be POST

user861594
- 5,733
- 3
- 29
- 45
-
i tried this method but still i am getting 500 internal server error from the server. when i remove username and password details web service throws the invalid username password error , with these details its throwing random fault. I will try to post the exact error. – hidayath raza Jan 12 '19 at 07:17
-
Did you tried by setting `rest.client.impl=com.qmetry.qaf.automation.rest.client.BasicAuthRestClient` and providing credentials as suggested above? – user861594 Jan 12 '19 at 20:10
-
Yes I tried by providing the same details as you insisted. I have to try providing the credentials in url. – hidayath raza Jan 13 '19 at 03:21
-
Share your request call and exception details. Error code 500 usually not because of authontication. – user861594 Jan 13 '19 at 06:15
-
hi, i tried the basicAuthRestClient params you shared above , added them to application.properties file, but getting below error.
env:Server -
below is the request call
{ "baseUrl":"url", "method":"POST", "headers":{ "Content-Type":"text/xml", "SOAPAction": "soapaction" }, "body":"file:example.xml" } – hidayath raza Jan 16 '19 at 05:04 -
-
This looks server error. Make sure you are providing correct soap action and sending message body with soap envelope or what expected by server. – user861594 Jan 18 '19 at 16:42