Thursday, August 30, 2012

How to set authentication object for web services

Problem Statement: In certain cases where the application under test (AUT) is a smart client application and the application uses web-services for it's operations. During recording of the application VUGen doesn't record the authentication object and while replaying the script you get the below error for the web services request(s):


An Authentication object was not found in the SecurityContext
The reason for the SOAP fault is: "An Authentication object was not found in the SecurityContext"

Solution: As mentioned above, the application being a smart client is mostly launched via a web-link where the run time jars / dlls are downloaded locally and application is launched. During launching itself the application takes the credentials from local system (your AD account details) and authenticates the user.

In case of replaying this operation in VUGen this authentication information is not available; this can be done by sending the authentication information in the header before the first web-service request as shown below:








Otherwise if your web service method has property for sending authentication object then you can do so in the request itself.

Hope this helps in solving your issue.

No comments:

Post a Comment