Search in sources :

Example 1 with SOAPFault

use of com.sun.identity.liberty.ws.soapbinding.SOAPFault 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 SOAPFault

use of com.sun.identity.liberty.ws.soapbinding.SOAPFault 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)

Example 3 with SOAPFault

use of com.sun.identity.liberty.ws.soapbinding.SOAPFault 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)

Aggregations

Message (com.sun.identity.liberty.ws.soapbinding.Message)3 SOAPFault (com.sun.identity.liberty.ws.soapbinding.SOAPFault)3 SOAPFaultDetail (com.sun.identity.liberty.ws.soapbinding.SOAPFaultDetail)3 SOAPFaultException (com.sun.identity.liberty.ws.soapbinding.SOAPFaultException)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 JAXBException (javax.xml.bind.JAXBException)2 InteractionSOAPFaultException (com.sun.identity.liberty.ws.interaction.InteractionSOAPFaultException)1 RedirectRequestElement (com.sun.identity.liberty.ws.interaction.jaxb.RedirectRequestElement)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