Examples of MessageInformationHeaders


Examples of org.apache.axis2.addressing.MessageInformationHeaders

                new MessageContext(msgContext.getSystemContext(),
                        msgContext.getSessionContext(),
                        msgContext.getTransportIn(),
                        msgContext.getTransportOut());

        MessageInformationHeaders oldMessageInfoHeaders =
                msgContext.getMessageInformationHeaders();
        MessageInformationHeaders messageInformationHeaders =
                new MessageInformationHeaders();
        messageInformationHeaders.setMessageId(UUIDGenerator.getUUID());
        messageInformationHeaders.setTo(oldMessageInfoHeaders.getReplyTo());
        messageInformationHeaders.setFaultTo(
                oldMessageInfoHeaders.getFaultTo());
        messageInformationHeaders.setFrom(oldMessageInfoHeaders.getTo());
        messageInformationHeaders.setRelatesTo(
                new RelatesTo(oldMessageInfoHeaders.getMessageId(),
                        AddressingConstants.Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE));
        messageInformationHeaders.setAction(oldMessageInfoHeaders.getAction());
        outMsgContext.setMessageInformationHeaders(messageInformationHeaders);
        outMsgContext.setOperationContext(msgContext.getOperationContext());
        outMsgContext.setServiceContext(msgContext.getServiceContext());
        outMsgContext.setServiceGroupContextId(msgContext.getServiceGroupContextId());
        outMsgContext.setProperty(MessageContext.TRANSPORT_OUT,
View Full Code Here

Examples of org.apache.axis2.addressing.MessageInformationHeaders

                        new MessageContext(messgeCtx.getSystemContext(),
                                messgeCtx.getSessionContext(),
                                messgeCtx.getTransportIn(),
                                messgeCtx.getTransportOut());
                   
                    MessageInformationHeaders oldMessageInfoHeaders =
                            messgeCtx.getMessageInformationHeaders();
                    MessageInformationHeaders messageInformationHeaders =
                            new MessageInformationHeaders();
                    messageInformationHeaders.setMessageId(UUIDGenerator.getUUID());
                    messageInformationHeaders.setTo(oldMessageInfoHeaders.getReplyTo());
                    messageInformationHeaders.setFaultTo(
                            oldMessageInfoHeaders.getFaultTo());
                    messageInformationHeaders.setFrom(oldMessageInfoHeaders.getTo());
                    messageInformationHeaders.setRelatesTo(
                            new RelatesTo(oldMessageInfoHeaders.getMessageId(),
                                    AddressingConstants.Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE));
                    messageInformationHeaders.setAction(oldMessageInfoHeaders.getAction());
                    newmsgCtx.setMessageInformationHeaders(messageInformationHeaders);
                    newmsgCtx.setOperationContext(messgeCtx.getOperationContext());
                    newmsgCtx.setServiceContext(messgeCtx.getServiceContext());
                    newmsgCtx.setProperty(MessageContext.TRANSPORT_OUT,
                            messgeCtx.getProperty(MessageContext.TRANSPORT_OUT));
View Full Code Here

Examples of org.apache.axis2.addressing.MessageInformationHeaders

        if (sessionContext == null) {
            this.sessionContext = new SessionContext(null);
        } else {
            this.sessionContext = sessionContext;
        }
        messageInformationHeaders = new MessageInformationHeaders();
        this.transportIn = transportIn;
        this.transportOut = transportOut;
        this.configurationContext = engineContext;

        if (transportIn != null)
View Full Code Here

Examples of org.apache.axis2.addressing.MessageInformationHeaders

    protected TransportOutDescription senderTransport;


    public InOnlyMEPClient(ServiceContext service) {
        super(service, WSDLConstants.MEP_URI_IN_ONLY);
        messageInformationHeaders = new MessageInformationHeaders();
    }
View Full Code Here

Examples of org.apache.axis2.addressing.MessageInformationHeaders

        try {
            StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(
                    testFileName);

            SOAPHeader header = ((SOAPEnvelope) omBuilder.getDocumentElement()).getHeader();
            MessageInformationHeaders messageInformationHeaders =
                    inHandler.extractCommonAddressingParameters(header,
                            null,
                            header.getHeaderBlocksWithNSURI(
                                    AddressingConstants.Submission.WSA_NAMESPACE),
                            AddressingConstants.Submission.WSA_NAMESPACE);

            if (messageInformationHeaders == null) {
                fail(
                        "Addressing Information Headers have not been retrieved properly");
            }
            assertEquals("action header is not correct",
                    messageInformationHeaders.getAction(),
                    action);
            assertEquals("action header is not correct",
                    messageInformationHeaders.getMessageId().trim(),
                    messageID.trim());

            assertFromEPR(messageInformationHeaders.getFrom());

        } catch (Exception e) {
            e.printStackTrace();
            log.info(e.getMessage());
            fail(" An Exception has occured " + e.getMessage());
View Full Code Here

Examples of org.apache.axis2.addressing.MessageInformationHeaders

        addressingNamespaceObject =
                OMAbstractFactory.getOMFactory().createOMNamespace(
                        addressingNamespace, WSA_DEFAULT_PRFIX);


        MessageInformationHeaders messageInformationHeaders =
                msgContext.getMessageInformationHeaders();
        SOAPHeader soapHeader = msgContext.getEnvelope().getHeader();


        EndpointReference epr = messageInformationHeaders.getTo();
        if (epr != null) {

            String address = epr.getAddress();
            if (!"".equals(address) && address != null) {
                SOAPHeaderBlock toHeaderBlock = soapHeader.addHeaderBlock(
                        WSA_TO, addressingNamespaceObject);
                toHeaderBlock.setText(address);
            }

            AnyContentType referenceParameters = epr.getReferenceParameters();
            if (referenceParameters != null) {
                processAnyContentType(referenceParameters, soapHeader);
            }

            addToHeader(epr, soapHeader);
        }

        String action = messageInformationHeaders.getAction();
        if (action != null) {
            processStringInfo(action, WSA_ACTION, soapHeader);
        }

        epr = messageInformationHeaders.getReplyTo();
        if (epr == null) {//optional
            // setting anonymous URI. Defaulting to Final.
            String anonymousURI = Final.WSA_ANONYMOUS_URL;
            if (Submission.WSA_NAMESPACE.equals(addressingNamespace)) {
                anonymousURI = Submission.WSA_ANONYMOUS_URL;
            }
            epr = new EndpointReference(anonymousURI);
        }
        // add the service group id as a reference parameter
        String serviceGroupContextId = msgContext.getServiceGroupContextId();
        if (serviceGroupContextId != null && !"".equals(serviceGroupContextId)) {
            if(epr.getReferenceParameters() == null){
                epr.setReferenceParameters(new AnyContentType());
            }
            epr.getReferenceParameters().addReferenceValue(new QName(Constants.AXIS2_NAMESPACE_URI,
                    Constants.SERVICE_GROUP_ID, Constants.AXIS2_NAMESPACE_PREFIX), serviceGroupContextId);
        }
        addToSOAPHeader(epr, AddressingConstants.WSA_REPLY_TO, soapHeader);


        epr = messageInformationHeaders.getFrom();
        if (epr != null) {//optional
            addToSOAPHeader(epr, AddressingConstants.WSA_FROM, soapHeader);
        }

        epr = messageInformationHeaders.getFaultTo();
        if (epr != null) {//optional
            addToSOAPHeader(epr, AddressingConstants.WSA_FAULT_TO, soapHeader);
        }

        String messageID = messageInformationHeaders.getMessageId();
        if (messageID != null) {//optional
            processStringInfo(messageID, WSA_MESSAGE_ID, soapHeader);
        }

        RelatesTo relatesTo = messageInformationHeaders.getRelatesTo();
        OMElement relatesToHeader = null;

        if (relatesTo != null) {
            relatesToHeader =
                    processStringInfo(relatesTo.getValue(),
View Full Code Here

Examples of org.apache.axis2.addressing.MessageInformationHeaders

            MessageInformationHeaders messageInformationHeaders,
            ArrayList addressingHeaders,
            String addressingNamespace)
            throws AddressingException {
        if (messageInformationHeaders == null) {
            messageInformationHeaders = new MessageInformationHeaders();
        }

        Iterator addressingHeadersIt = addressingHeaders.iterator();
        while (addressingHeadersIt.hasNext()) {
            SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) addressingHeadersIt.next();
View Full Code Here

Examples of org.apache.axis2.addressing.MessageInformationHeaders

                xmlComparator.compare(omBuilder.getDocumentElement(),
                        defaultEnvelope));
    }

    public void testHeaderCreationFromMsgCtxtInformation() throws Exception {
        MessageInformationHeaders mIHeaders = new MessageInformationHeaders();

        AnyContentType referenceValues = new AnyContentType();

        EndpointReference epr = new EndpointReference("http://www.from.org/service/");
        referenceValues.addReferenceValue(new QName("Reference2"),
                "Value 200");
        epr.setReferenceParameters(referenceValues);
        mIHeaders.setFrom(epr);

        epr = new EndpointReference("http://www.to.org/service/");
        referenceValues = new AnyContentType();
        referenceValues.addReferenceValue(
                new QName("http://reference.org", "Reference4", "myRef"),
                "Value 400");
        referenceValues.addReferenceValue(
                new QName("http://reference.org", "Reference3", "myRef"),
                "Value 300");
        epr.setReferenceParameters(referenceValues);

        epr.setServiceName(
                new ServiceName(
                        new QName("http://www.from.org/service/",
                                "Service",
                                "serviceNS"),
                        "port"));

        epr.setInterfaceName(
                new QName("http://www.from.org/service/port/",
                        "Port",
                        "portNS"));
        mIHeaders.setTo(epr);

        epr =
                new EndpointReference("http://www.replyTo.org/service/");
        mIHeaders.setReplyTo(epr);

        mIHeaders.setMessageId("123456-7890");
        mIHeaders.setAction("http://www.actions.org/action");

        RelatesTo relatesTo = new RelatesTo(
                "http://www.relatesTo.org/service/", "TestRelation");
        mIHeaders.setRelatesTo(relatesTo);

        msgCtxt = new MessageContext(null);
        msgCtxt.setMessageInformationHeaders(mIHeaders);
        msgCtxt.setEnvelope(
                OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope());
View Full Code Here

Examples of org.apache.axis2.addressing.MessageInformationHeaders

        addressingNamespaceObject =
                OMAbstractFactory.getOMFactory().createOMNamespace(
                        addressingNamespace, WSA_DEFAULT_PREFIX);


        MessageInformationHeaders messageInformationHeaders =
                msgContext.getMessageInformationHeaders();
        SOAPHeader soapHeader = msgContext.getEnvelope().getHeader();

        // by this time, we definitely have some addressing information to be sent. This is because,
        // we have tested at the start of this whether messageInformationHeaders are null or not.
        // So rather than declaring addressing namespace in each and every addressing header, lets
        // define that in the Header itself.
        soapHeader.declareNamespace(addressingNamespaceObject);

        // processing WSA To
        EndpointReference epr = messageInformationHeaders.getTo();
        if (epr != null && !isAddressingHeaderAlreadyAvailable(WSA_TO, soapHeader)) {

            String address = epr.getAddress();
            if (!"".equals(address) && address != null) {
                SOAPHeaderBlock toHeaderBlock = soapHeader.addHeaderBlock(
                        WSA_TO, addressingNamespaceObject);
                toHeaderBlock.setText(address);
            }

            AnyContentType referenceParameters = epr.getReferenceParameters();
            if (referenceParameters != null) {
                processAnyContentType(referenceParameters, soapHeader);
            }

            addToHeader(epr, soapHeader);
        }

        // processing WSA Action
        String action = messageInformationHeaders.getAction();
        if (action != null && !isAddressingHeaderAlreadyAvailable(WSA_ACTION, soapHeader)) {
            processStringInfo(action, WSA_ACTION, soapHeader);
        }

        // processing WSA replyTo
        if (!isAddressingHeaderAlreadyAvailable(WSA_REPLY_TO, soapHeader)) {
            epr = messageInformationHeaders.getReplyTo();
            if (epr == null) {//optional
                // setting anonymous URI. Defaulting to Final.
                String anonymousURI = Final.WSA_ANONYMOUS_URL;
                if (Submission.WSA_NAMESPACE.equals(addressingNamespace)) {
                    anonymousURI = Submission.WSA_ANONYMOUS_URL;
                }
                epr = new EndpointReference(anonymousURI);
            }
            // add the service group id as a reference parameter
            String serviceGroupContextId = msgContext.getServiceGroupContextId();
            if (serviceGroupContextId != null && !"".equals(serviceGroupContextId)) {
                if (epr.getReferenceParameters() == null) {
                    epr.setReferenceParameters(new AnyContentType());
                }
                epr.getReferenceParameters().addReferenceValue(new QName(Constants.AXIS2_NAMESPACE_URI,
                        Constants.SERVICE_GROUP_ID, Constants.AXIS2_NAMESPACE_PREFIX), serviceGroupContextId);
            }
            addToSOAPHeader(epr, AddressingConstants.WSA_REPLY_TO, soapHeader);
        }

        epr = messageInformationHeaders.getFrom();
        if (epr != null) {//optional
            addToSOAPHeader(epr, AddressingConstants.WSA_FROM, soapHeader);
        }

        epr = messageInformationHeaders.getFaultTo();
        if (epr != null) {//optional
            addToSOAPHeader(epr, AddressingConstants.WSA_FAULT_TO, soapHeader);
        }

        String messageID = messageInformationHeaders.getMessageId();
        if (messageID != null && !isAddressingHeaderAlreadyAvailable(WSA_MESSAGE_ID, soapHeader)) {//optional
            processStringInfo(messageID, WSA_MESSAGE_ID, soapHeader);
        }

        if (!isAddressingHeaderAlreadyAvailable(WSA_RELATES_TO, soapHeader)) {
            org.apache.axis2.addressing.RelatesTo relatesTo = messageInformationHeaders.getRelatesTo();
            OMElement relatesToHeader = null;

            if (relatesTo != null) {
                relatesToHeader =
                        processStringInfo(relatesTo.getValue(),
View Full Code Here

Examples of org.apache.axis2.addressing.MessageInformationHeaders

            MessageInformationHeaders messageInformationHeaders,
            ArrayList addressingHeaders,
            String addressingNamespace)
            throws AddressingException {
        if (messageInformationHeaders == null) {
            messageInformationHeaders = new MessageInformationHeaders();
        }

        Iterator addressingHeadersIt = addressingHeaders.iterator();
        while (addressingHeadersIt.hasNext()) {
            SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) addressingHeadersIt.next();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.