Package eu.mosaic_cloud.platform.interop.idl

Examples of eu.mosaic_cloud.platform.interop.idl.IdlCommon$Envelope


        if (!inTransport.getHTTPMethod().equalsIgnoreCase("POST")) {
            throw new MessageDecodingException("This message decoder only supports the HTTP POST method");
        }

        log.debug("Unmarshalling SOAP message");
        Envelope soapMessage = (Envelope) unmarshallMessage(inTransport.getIncomingStream());
        samlMsgCtx.setInboundMessage(soapMessage);

        Header messageHeader = soapMessage.getHeader();
        if (messageHeader != null) {
            checkUnderstoodSOAPHeaders(soapMessage.getHeader().getUnknownXMLObjects());
        }

        List<XMLObject> soapBodyChildren = soapMessage.getBody().getUnknownXMLObjects();
        if (soapBodyChildren.size() < 1 || soapBodyChildren.size() > 1) {
            log.error("Unexpected number of children in the SOAP body, " + soapBodyChildren.size()
                    + ".  Unable to extract SAML message");
            throw new MessageDecodingException(
                    "Unexpected number of children in the SOAP body, unable to extract SAML message");
View Full Code Here


        if (samlMessage == null) {
            throw new MessageEncodingException("No outbound SAML message contained in message context");
        }

        signMessage(samlMsgCtx);
        Envelope envelope = buildSOAPMessage(samlMsgCtx, samlMessage);

        Element envelopeElem = marshallMessage(envelope);
        try {
            HTTPOutTransport outTransport = (HTTPOutTransport) messageContext.getOutboundMessageTransport();
            HTTPTransportUtils.addNoCacheHeaders(outTransport);
View Full Code Here

     *
     * @return the SOAP message
     */
    @SuppressWarnings("unchecked")
    protected Envelope buildSOAPMessage(SAMLMessageContext samlMsgCtx, SAMLObject samlMessage) {
        Envelope envelope = null;
        if (samlMsgCtx.getOutboundMessage() != null && samlMsgCtx.getOutboundMessage() instanceof Envelope) {
            envelope = (Envelope) samlMsgCtx.getOutboundMessage();
            Body body = envelope.getBody();
            if (body == null) {
                XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
                SOAPObjectBuilder<Body> bodyBuilder = (SOAPObjectBuilder<Body>) builderFactory
                        .getBuilder(Body.DEFAULT_ELEMENT_NAME);
                body = bodyBuilder.buildObject();
                envelope.setBody(body);
            } else if (!body.getUnknownXMLObjects().isEmpty()) {
                log.warn("Supplied SOAP Envelope Body was not empty. Existing contents will be removed.");
                body.getUnknownXMLObjects().clear();
            }
            body.getUnknownXMLObjects().add(samlMessage);
View Full Code Here

        log.debug("Building SOAP message");
        XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();

        SOAPObjectBuilder<Envelope> envBuilder = (SOAPObjectBuilder<Envelope>) builderFactory
                .getBuilder(Envelope.DEFAULT_ELEMENT_NAME);
        Envelope envelope = envBuilder.buildObject();

        log.debug("Adding SAML message to the SOAP message's body");
        SOAPObjectBuilder<Body> bodyBuilder = (SOAPObjectBuilder<Body>) builderFactory
                .getBuilder(Body.DEFAULT_ELEMENT_NAME);
        Body body = bodyBuilder.buildObject();
        body.getUnknownXMLObjects().add(samlMessage);
        envelope.setBody(body);

        return envelope;
    }
View Full Code Here

     * @return the minimal SOAP message envelope skeleton
     */
    protected Envelope buildSOAPEnvelope(MessageContext messageContext) {
        log.debug("Building SOAP envelope");

        Envelope envelope = envBuilder.buildObject();

        Body body = bodyBuilder.buildObject();
        envelope.setBody(body);

        return envelope;
    }
View Full Code Here

     *
     * @param messageContext the current message context being processed
     * @return a SOAPAction HTTP header URI value
     */
    protected String getSOAPAction(MessageContext messageContext) {
        Envelope env = (Envelope) messageContext.getOutboundMessage();
        Header header = env.getHeader();
        if (header == null) {
            return null;
        }
        List<XMLObject> objList = header.getUnknownXMLObjects(Action.ELEMENT_NAME);
        if (objList == null || objList.isEmpty()) {
View Full Code Here

     * @throws SOAPClientException thrown if there is a problem reading the response from the {@link PostMethod}
     */
    protected void processSuccessfulResponse(PostMethod httpMethod, SOAPMessageContext messageContext)
            throws SOAPClientException {
        try {
            Envelope response = unmarshallResponse(httpMethod.getResponseBodyAsStream());
            messageContext.setInboundMessage(response);
            evaluateSecurityPolicy(messageContext);
        } catch (IOException e) {
            throw new SOAPClientException("Unable to read response", e);
        }
View Full Code Here

     * @throws SOAPFaultException an exception containing the SOAP fault
     */
    protected void processFaultResponse(PostMethod httpMethod, SOAPMessageContext messageContext)
            throws SOAPClientException, SOAPFaultException {
        try {
            Envelope response = unmarshallResponse(httpMethod.getResponseBodyAsStream());
            messageContext.setInboundMessage(response);

            List<XMLObject> faults = response.getBody().getUnknownXMLObjects(Fault.DEFAULT_ELEMENT_NAME);
            if (faults.size() < 1) {
                throw new SOAPClientException("HTTP status code was 500 but SOAP response did not contain a Fault");
            }
            Fault fault = (Fault) faults.get(0);

View Full Code Here

    protected void doDecode(MessageContext messageContext) throws MessageDecodingException {

        InTransport inTransport = messageContext.getInboundMessageTransport();

        log.debug("Unmarshalling SOAP message");
        Envelope soapMessage = (Envelope) unmarshallMessage(inTransport.getIncomingStream());
        messageContext.setInboundMessage(soapMessage);
    }
View Full Code Here

     *              this node but was not understood
     */
    private void checkUnderstoodSOAPHeaders(MessageContext messageContext)
            throws MessageDecodingException {
       
        Envelope envelope = (Envelope) messageContext.getInboundMessage();
        Header soapHeader = envelope.getHeader();
        if (soapHeader == null) {
            log.debug("SOAP Envelope contained no Header");
            return;
        }
        List<XMLObject> headers = soapHeader.getUnknownXMLObjects();
View Full Code Here

TOP

Related Classes of eu.mosaic_cloud.platform.interop.idl.IdlCommon$Envelope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.