Search in sources :

Example 6 with SOAPObjectBuilder

use of org.opensaml.soap.common.SOAPObjectBuilder in project cas by apereo.

the class ECPSamlIdPProfileHandlerControllerTests method getEnvelope.

private Envelope getEnvelope(final String entityId) {
    var builder = (SOAPObjectBuilder) openSamlConfigBean.getBuilderFactory().getBuilder(Envelope.DEFAULT_ELEMENT_NAME);
    var envelope = (Envelope) builder.buildObject();
    builder = (SOAPObjectBuilder) openSamlConfigBean.getBuilderFactory().getBuilder(Header.DEFAULT_ELEMENT_NAME);
    val header = (Header) builder.buildObject();
    envelope.setHeader(header);
    builder = (SOAPObjectBuilder) openSamlConfigBean.getBuilderFactory().getBuilder(Body.DEFAULT_ELEMENT_NAME);
    val body = (Body) builder.buildObject();
    body.getUnknownXMLObjects().add(getAuthnRequest(entityId));
    envelope.setBody(body);
    return envelope;
}
Also used : lombok.val(lombok.val) SOAPObjectBuilder(org.opensaml.soap.common.SOAPObjectBuilder) Header(org.opensaml.soap.soap11.Header) Envelope(org.opensaml.soap.soap11.Envelope) Body(org.opensaml.soap.soap11.Body)

Aggregations

SOAPObjectBuilder (org.opensaml.soap.common.SOAPObjectBuilder)6 lombok.val (lombok.val)5 Body (org.opensaml.soap.soap11.Body)3 Envelope (org.opensaml.soap.soap11.Envelope)3 Header (org.opensaml.soap.soap11.Header)3 Order (org.junit.jupiter.api.Order)2 Test (org.junit.jupiter.api.Test)2 TestMethodOrder (org.junit.jupiter.api.TestMethodOrder)2 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)2 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)2 QName (javax.xml.namespace.QName)1 SneakyThrows (lombok.SneakyThrows)1 MockTicketGrantingTicket (org.apereo.cas.mock.MockTicketGrantingTicket)1