Yes VA based Webservices connector supports the After Operation Rule. I would suggest you review the following solution to see if you can use Before Operation Rule approach for your case.
Since my initial post I have created and attached a webservice after operation rule to my custom authentication operation but was waiting some action from application owner for the permissions configuration.
The following after rule works correctly :
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Map result = new HashMap();
try {
String rawToken = (rawResponseObject != null) ? rawResponseObject.trim() : "";
if (rawToken.startsWith("\"") && rawToken.endsWith("\"") && rawToken.length() > 1) {
rawToken = rawToken.substring(1, rawToken.length() - 1);
}
log.debug("Custom Auth After Rule : token received, length = " + rawToken.length());
if (!rawToken.isEmpty()) {
Map tokenMap = new HashMap();
tokenMap.put("accesstoken", rawToken);
List dataList = new ArrayList();
dataList.add(tokenMap);
result.put("data", dataList);
} else {
log.error("Custom Auth After Rule : token response was empty");
}
} catch (Exception e) {
log.error("Custom Auth After Rule : exception occurred : " + e);
}
return result;
In my Custom Authentication operation, I didn’t map anything in the response mapping. Instead, I populated the accesstoken in the after rule. For the other operations, I simply pass $application.accesstoken$ as the token.