Search in sources :

Example 1 with SOAPFaultDetail

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;
}
Also used : Message(com.sun.identity.liberty.ws.soapbinding.Message) JAXBException(javax.xml.bind.JAXBException) StatusElement(com.sun.identity.liberty.ws.interaction.jaxb.StatusElement) ArrayList(java.util.ArrayList) SOAPFaultDetail(com.sun.identity.liberty.ws.soapbinding.SOAPFaultDetail) ArrayList(java.util.ArrayList) List(java.util.List) SOAPFault(com.sun.identity.liberty.ws.soapbinding.SOAPFault) SOAPFaultException(com.sun.identity.liberty.ws.soapbinding.SOAPFaultException)

Example 2 with SOAPFaultDetail

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;
}
Also used : Message(com.sun.identity.liberty.ws.soapbinding.Message) CorrelationHeader(com.sun.identity.liberty.ws.soapbinding.CorrelationHeader) JAXBException(javax.xml.bind.JAXBException) ArrayList(java.util.ArrayList) RedirectRequestElement(com.sun.identity.liberty.ws.interaction.jaxb.RedirectRequestElement) SOAPFaultDetail(com.sun.identity.liberty.ws.soapbinding.SOAPFaultDetail) ArrayList(java.util.ArrayList) List(java.util.List) SOAPFault(com.sun.identity.liberty.ws.soapbinding.SOAPFault) SOAPFaultException(com.sun.identity.liberty.ws.soapbinding.SOAPFaultException)

Example 3 with SOAPFaultDetail

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;
}
Also used : JAXBException(javax.xml.bind.JAXBException) SOAPFaultDetail(com.sun.identity.liberty.ws.soapbinding.SOAPFaultDetail) RedirectRequestElement(com.sun.identity.liberty.ws.interaction.jaxb.RedirectRequestElement) ArrayList(java.util.ArrayList) List(java.util.List)

Example 4 with SOAPFaultDetail

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;
}
Also used : Message(com.sun.identity.liberty.ws.soapbinding.Message) QName(javax.xml.namespace.QName) ServiceInstanceUpdateHeader(com.sun.identity.liberty.ws.soapbinding.ServiceInstanceUpdateHeader) SOAPFaultDetail(com.sun.identity.liberty.ws.soapbinding.SOAPFaultDetail) SOAPFault(com.sun.identity.liberty.ws.soapbinding.SOAPFault) SOAPFaultException(com.sun.identity.liberty.ws.soapbinding.SOAPFaultException) InteractionSOAPFaultException(com.sun.identity.liberty.ws.interaction.InteractionSOAPFaultException) ServiceInstanceUpdate(com.sun.identity.liberty.ws.interfaces.ServiceInstanceUpdate)

Aggregations

SOAPFaultDetail (com.sun.identity.liberty.ws.soapbinding.SOAPFaultDetail)4 Message (com.sun.identity.liberty.ws.soapbinding.Message)3 SOAPFault (com.sun.identity.liberty.ws.soapbinding.SOAPFault)3 SOAPFaultException (com.sun.identity.liberty.ws.soapbinding.SOAPFaultException)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 JAXBException (javax.xml.bind.JAXBException)3 RedirectRequestElement (com.sun.identity.liberty.ws.interaction.jaxb.RedirectRequestElement)2 InteractionSOAPFaultException (com.sun.identity.liberty.ws.interaction.InteractionSOAPFaultException)1 StatusElement (com.sun.identity.liberty.ws.interaction.jaxb.StatusElement)1 ServiceInstanceUpdate (com.sun.identity.liberty.ws.interfaces.ServiceInstanceUpdate)1 CorrelationHeader (com.sun.identity.liberty.ws.soapbinding.CorrelationHeader)1 ServiceInstanceUpdateHeader (com.sun.identity.liberty.ws.soapbinding.ServiceInstanceUpdateHeader)1 QName (javax.xml.namespace.QName)1