use of com.sun.identity.liberty.ws.interaction.InteractionManager in project OpenAM by OpenRock.
the class DSTClient method handleInteraction.
/**
* Handles interaction request processing.
* When the interaction is required, it throws and InteractRedirect
* Exception, and redirect to the caller application(servlet).
*/
private Message handleInteraction(Message requestMsg) throws DSTException, SOAPFaultException, SOAPBindingException, InteractionRedirectException {
if (requestMsg == null || httpRequest == null || httpResponse == null || soapURI == null) {
DSTUtils.debug.error("DSTClient:handeInteraction:null values");
throw new DSTException(DSTUtils.bundle.getString("nullInputParams"));
}
DSTUtils.debug.message("DSTClient:handleInteraction:init");
String resend = httpRequest.getParameter(InteractionManager.RESEND_MESSAGE);
String returnURL = httpRequest.getRequestURL().toString();
Message response;
try {
InteractionManager manager = InteractionManager.getInstance();
if (resend == null) {
//If the interaction is not required, this will send a
// original response.
response = manager.sendRequest(requestMsg, soapURI, certAlias, soapAction, returnURL, httpRequest, httpResponse);
} else {
response = manager.resendRequest(returnURL, httpRequest, httpResponse);
}
return response;
} catch (InteractionRedirectException ire) {
DSTUtils.debug.message("DSTClient:handleInteraction: Interaction" + "Redirection happened.");
throw ire;
} catch (InteractionException ie) {
DSTUtils.debug.error("DSTClient:handleInteraction: Interaction" + " Error occured.", ie);
throw new DSTException(ie);
}
}
Aggregations