Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPEnvelope


                if (responseMessageContext.getEnvelope() == null) {
                    // If request is REST we assume the responseMessageContext is
                    // REST, so set the variable

                    SOAPEnvelope resenvelope =
                        TransportUtils.createSOAPMessage(responseMessageContext);

                    if (resenvelope != null) {
                        responseMessageContext.setEnvelope(resenvelope);
                        AxisEngine.receive(responseMessageContext);
View Full Code Here


                // Send the subscription responce
                if (log.isDebugEnabled()) {
                    log.debug("Sending subscription response for SynapseSubscription ID : " +
                            subscription.getId());
                }
                SOAPEnvelope soapEnvelope =
                        messageBuilder.genSubscriptionResponse(subscription);
                dispatchResponse(soapEnvelope, EventingConstants.WSE_SUbSCRIBE_RESPONSE,
                        mc, false);
            } else {
                // Send the Fault responce
                if (log.isDebugEnabled()) {
                    log.debug("SynapseSubscription Failed, sending fault response");
                }
                SOAPEnvelope soapEnvelope = messageBuilder.genFaultResponse(mc,
                        EventingConstants.WSE_FAULT_CODE_RECEIVER, "EventSourceUnableToProcess",
                        "Unable to subscribe ", "");
                dispatchResponse(soapEnvelope, EventingConstants.WSA_FAULT, mc,
                        true);
            }
        } else {
            // Send the Fault responce
            if (log.isDebugEnabled()) {
                log.debug("SynapseSubscription Failed, sending fault response");
            }
            SOAPEnvelope soapEnvelope = messageBuilder.genFaultResponse(mc,
                    SubscriptionMessageBuilder.getErrorCode(),
                    SubscriptionMessageBuilder.getErrorSubCode(),
                    SubscriptionMessageBuilder.getErrorReason(), "");
            dispatchResponse(soapEnvelope, EventingConstants.WSA_FAULT, mc,
                    true);
View Full Code Here

            //send the response
            if (log.isDebugEnabled()) {
                log.debug("Sending UnSubscribe responce for SynapseSubscription ID : " +
                        subscription.getId());
            }
            SOAPEnvelope soapEnvelope = messageBuilder.genUnSubscribeResponse(subscription);
            dispatchResponse(soapEnvelope, EventingConstants.WSE_UNSUBSCRIBE_RESPONSE,
                    mc, false);
        } else {
            // Send the Fault responce
            if (log.isDebugEnabled()) {
                log.debug("UnSubscription failed, sending fault repsponse");
            }
            SOAPEnvelope soapEnvelope = messageBuilder.genFaultResponse(mc,
                    EventingConstants.WSE_FAULT_CODE_RECEIVER, "EventSourceUnableToProcess",
                    "Unable to Unsubscribe", "");
            dispatchResponse(soapEnvelope, EventingConstants.WSA_FAULT, mc,
                    true);
        }
View Full Code Here

            if (log.isDebugEnabled()) {
                log.debug("Sending GetStatus responce for SynapseSubscription ID : " +
                        subscription.getId());
            }
            //send the responce
            SOAPEnvelope soapEnvelope = messageBuilder.genGetStatusResponse(subscription);
            dispatchResponse(soapEnvelope, EventingConstants.WSE_GET_STATUS_RESPONSE,
                    mc, false);
        } else {
            // Send the Fault responce
            if (log.isDebugEnabled()) {
                log.debug("GetStatus failed, sending fault response");
            }
            SOAPEnvelope soapEnvelope = messageBuilder.genFaultResponse(mc,
                    EventingConstants.WSE_FAULT_CODE_RECEIVER, "EventSourceUnableToProcess",
                    "Subscription Not Found", "");
            dispatchResponse(soapEnvelope, EventingConstants.WSA_FAULT, mc,
                    true);
        }
View Full Code Here

                //send the response
                if (log.isDebugEnabled()) {
                    log.debug("Sending ReNew response for SynapseSubscription ID : " +
                            subscription.getId());
                }
                SOAPEnvelope soapEnvelope =
                        messageBuilder.genRenewSubscriptionResponse(subscription);
                dispatchResponse(soapEnvelope, EventingConstants.WSE_RENEW_RESPONSE,
                        mc, false);
            } else {
                // Send the Fault responce
                if (log.isDebugEnabled()) {
                    log.debug("ReNew failed, sending fault response");
                }
                SOAPEnvelope soapEnvelope = messageBuilder.genFaultResponse(mc,
                        EventingConstants.WSE_FAULT_CODE_RECEIVER, "UnableToRenew",
                        "Subscription Not Found", "");
                dispatchResponse(soapEnvelope, EventingConstants.WSA_FAULT, mc,
                        true);
            }
        } else {
            SOAPEnvelope soapEnvelope = messageBuilder.genFaultResponse(mc,
                    SubscriptionMessageBuilder.getErrorCode(),
                    SubscriptionMessageBuilder.getErrorSubCode(),
                    SubscriptionMessageBuilder.getErrorReason(), "");
            dispatchResponse(soapEnvelope, EventingConstants.WSA_FAULT, mc, true);
        }
View Full Code Here

    public static final String NAME = "SynapseMustUnderstandHandler";
   
    public InvocationResponse invoke(MessageContext messageContext) throws AxisFault {

        SOAPEnvelope envelope = messageContext.getEnvelope();

        if (envelope.getHeader() != null) {
            Iterator headerBlocks = envelope.getHeader().getHeadersToProcess(null);
            ArrayList<SOAPHeaderBlock> markedHeaderBlocks = new ArrayList<SOAPHeaderBlock>();

            while (headerBlocks.hasNext()) {
                SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) headerBlocks.next();
View Full Code Here

        org.apache.axis2.context.MessageContext mc =
                new org.apache.axis2.context.MessageContext();
        SynapseConfiguration config = new SynapseConfiguration();
        SynapseEnvironment env = new Axis2SynapseEnvironment(config);
        MessageContext synMc = new Axis2MessageContext(mc, config, env);
        SOAPEnvelope envelope =
                OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        OMDocument omDoc =
                OMAbstractFactory.getSOAP11Factory().createOMDocument();
        omDoc.addChild(envelope);

        envelope.getBody().addChild(createOMElement(payload));

        synMc.setEnvelope(envelope);
        return synMc;
    }
View Full Code Here

        return msgContext;
    }

    public void addBodyToMessageContext(MessageContext msgContext, OMElement element) throws AxisFault {
   
        SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        SOAPBody body = envelope.getBody();
        body.addChild(element);
        msgContext.setEnvelope(envelope);
    }
View Full Code Here

   
    public void addSoapFaultToMessageContext(MessageContext msgContext, String faultCode,
            String faultReason, String faultDetail) throws AxisFault {
       
        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope faultEnvelope = factory.getDefaultFaultEnvelope();      
        SOAPFault soapFault = faultEnvelope.getBody().getFault();

        SOAPFaultCode soapFaultCode = factory.createSOAPFaultCode();
        soapFaultCode.setText(faultCode);
        soapFault.setCode(soapFaultCode);
       
View Full Code Here

        try {
            MessageContext msgCtx = TestUtils.getAxis2MessageContext("<empty/>", null).
                    getAxis2MessageContext();
            ResponseMessageBuilder builder = new ResponseMessageBuilder(msgCtx);
            SOAPEnvelope env = builder.genSubscriptionResponse(sub);
            OMElement resultOm = env.getBody().getFirstElement();
            OMElement expectedOm = AXIOMUtil.stringToOM(expected);
            assertTrue(compare(expectedOm, resultOm));

        } catch (Exception e) {
            fail("Error while constructing the test message context: " + e.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.SOAPEnvelope

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.