use of com.sun.identity.liberty.ws.soapbinding.SOAPFaultDetail in project OpenAM by OpenRock.
the class InteractionManager method newRedirectFaultError.
private SOAPFaultException newRedirectFaultError(QName errorCode) {
StatusElement se = null;
try {
se = objectFactory.createStatusElement();
} catch (JAXBException je) {
debug.error("InteractionManager.newRedirectFaultError():" + " can not create StatusElement", je);
}
se.setCode(errorCode);
List details = new ArrayList();
try {
details.add(Utils.convertJAXBToElement(se));
} catch (JAXBException je) {
debug.error("InteractionManager.newRedirectFaultError():" + "can not create new RedirectFaultError:" + "can not convert JAXBObject to Element", je);
}
SOAPFault sf = new SOAPFault(QNAME_SERVER, SERVER_ERROR, FAULT_ACTOR, new SOAPFaultDetail(details));
SOAPFaultException sfe = new SOAPFaultException(new Message(sf));
return sfe;
}
use of com.sun.identity.liberty.ws.soapbinding.SOAPFaultDetail in project OpenAM by OpenRock.
the class InteractionManager method newRedirectFault.
private SOAPFaultException newRedirectFault(String messageID) {
RedirectRequestElement re = null;
try {
re = objectFactory.createRedirectRequestElement();
} catch (JAXBException je) {
debug.error("InteractionManager.newRedirectFault():" + " can not create RedirectRequestElement", je);
}
CorrelationHeader ch = new CorrelationHeader();
String responseID = ch.getMessageID();
ch.setRefToMessageID(messageID);
String redirectUrl = null;
String lbRedirectUrl = interactionConfig.getLbWSPRedirectHandler();
String wspRedirectUrl = interactionConfig.getWSPRedirectHandler();
if (debug.messageEnabled()) {
debug.message("InteractionManager.newRedirectURLFault():" + "wspRedirectURL:" + wspRedirectUrl + ", lbRedirectUrl:" + lbRedirectUrl);
}
if (lbRedirectUrl == null) {
redirectUrl = wspRedirectUrl + "?" + TRANS_ID + "=" + responseID;
if (debug.messageEnabled()) {
debug.message("InteractionManager.newRedirectURLFault():" + "lbRedirectURL is null, rediectUrl:" + redirectUrl);
}
} else {
//lbRedirectUrl defined
redirectUrl = lbRedirectUrl + "?" + TRANS_ID + "=" + responseID + "&" + InteractionConfig.HANDLER_HOST_ID + "=" + InteractionConfig.getInstance().getLocalServerId();
if (debug.messageEnabled()) {
debug.message("InteractionManager.newRedirectURLFault():" + "lbRedirectURL is not null, rediectUrl:" + redirectUrl);
}
}
re.setRedirectURL(redirectUrl);
List details = new ArrayList();
try {
details.add(Utils.convertJAXBToElement(re));
} catch (JAXBException je) {
debug.error("InteractionManager.newRedirectFault():" + " can not create newRedirectFault:" + " can not convert JAXBObject to Element", je);
}
SOAPFault sf = new SOAPFault(QNAME_SERVER, SERVER_ERROR, FAULT_ACTOR, new SOAPFaultDetail(details));
Message sfmsg = new Message(sf);
sfmsg.setCorrelationHeader(ch);
SOAPFaultException sfe = new SOAPFaultException(sfmsg);
return sfe;
}
use of com.sun.identity.liberty.ws.soapbinding.SOAPFaultDetail in project OpenAM by OpenRock.
the class InteractionManager method getRedirectURL.
String getRedirectURL(SOAPFaultException sfe) throws SOAPFaultException {
String redirectURL = null;
List details = null;
SOAPFaultDetail sfd = sfe.getSOAPFaultMessage().getSOAPFault().getDetail();
if (sfd != null) {
details = sfd.getOtherChildren();
}
try {
details = Utils.convertElementToJAXB(details);
} catch (JAXBException je) {
debug.error("InteractionManager.getRedirectURL():" + " can not get Redirect URL", je);
}
if ((details != null) && (details.size() > 0) && (details.get(0) instanceof RedirectRequestElement)) {
RedirectRequestElement rre = (RedirectRequestElement) details.get(0);
if (rre != null) {
redirectURL = rre.getRedirectURL();
}
}
if (redirectURL == null) {
throw sfe;
}
return redirectURL;
}
use of com.sun.identity.liberty.ws.soapbinding.SOAPFaultDetail in project OpenAM by OpenRock.
the class PPRequestHandler method getServiceInstanceUpdateHeader.
/**
* Gets the service instance update header.
*
* @exception SOAPFaultException.
*/
private ServiceInstanceUpdateHeader getServiceInstanceUpdateHeader() throws SOAPFaultException {
ServiceInstanceUpdate siu = IDPPServiceManager.getInstance().getServiceInstanceUpdate();
ServiceInstanceUpdateHeader siuHeader = siu.getServiceInstanceUpdateHeader();
if (siu.isSOAPFaultNeeded()) {
QName faultCodeServer = new QName(SOAPBindingConstants.NS_SOAP, "Server");
SOAPFaultDetail detail = new SOAPFaultDetail(SOAPFaultDetail.ENDPOINT_MOVED, null, null);
SOAPFault sf = new SOAPFault(faultCodeServer, IDPPUtils.bundle.getString("endPointMoved"), null, detail);
Message sfmsg = new Message(sf);
sfmsg.setServiceInstanceUpdateHeader(siuHeader);
SOAPFaultException sfe = new SOAPFaultException(sfmsg);
throw sfe;
}
return siuHeader;
}
Aggregations