Search in sources :

Example 1 with FaultActor

use of org.opensaml.soap.soap11.FaultActor in project cas by apereo.

the class SamlProfileSamlSoap11FaultResponseBuilder method build.

@Override
public Envelope build(final AuthnRequest authnRequest, final HttpServletRequest request, final HttpServletResponse response, final org.jasig.cas.client.validation.Assertion casAssertion, final SamlRegisteredService service, final SamlRegisteredServiceServiceProviderMetadataFacade adaptor) throws SamlException {
    final Header header = newSoapObject(Header.class);
    final Body body = newSoapObject(Body.class);
    final Fault fault = newSoapObject(Fault.class);
    final FaultCode faultCode = newSoapObject(FaultCode.class);
    faultCode.setValue(FaultCode.SERVER);
    fault.setCode(faultCode);
    final FaultActor faultActor = newSoapObject(FaultActor.class);
    faultActor.setValue(SamlIdPUtils.getIssuerFromSamlRequest(authnRequest));
    fault.setActor(faultActor);
    final FaultString faultString = newSoapObject(FaultString.class);
    faultString.setValue(request.getAttribute(SamlIdPConstants.REQUEST_ATTRIBUTE_ERROR).toString());
    fault.setMessage(faultString);
    body.getUnknownXMLObjects().add(fault);
    final Envelope envelope = newSoapObject(Envelope.class);
    envelope.setHeader(header);
    envelope.setBody(body);
    encodeFinalResponse(request, response, service, adaptor, envelope);
    return envelope;
}
Also used : FaultCode(org.opensaml.soap.soap11.FaultCode) FaultActor(org.opensaml.soap.soap11.FaultActor) Header(org.opensaml.soap.soap11.Header) Fault(org.opensaml.soap.soap11.Fault) FaultString(org.opensaml.soap.soap11.FaultString) Envelope(org.opensaml.soap.soap11.Envelope) Body(org.opensaml.soap.soap11.Body)

Aggregations

Body (org.opensaml.soap.soap11.Body)1 Envelope (org.opensaml.soap.soap11.Envelope)1 Fault (org.opensaml.soap.soap11.Fault)1 FaultActor (org.opensaml.soap.soap11.FaultActor)1 FaultCode (org.opensaml.soap.soap11.FaultCode)1 FaultString (org.opensaml.soap.soap11.FaultString)1 Header (org.opensaml.soap.soap11.Header)1