Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPHeader


     */
    public static SOAPEnvelope removeAddressingHeaders(
        org.apache.axis2.context.MessageContext axisMsgCtx) {

        SOAPEnvelope env = axisMsgCtx.getEnvelope();
        SOAPHeader soapHeader = env.getHeader();
        ArrayList addressingHeaders;

        if (soapHeader != null) {
            addressingHeaders =
                soapHeader.getHeaderBlocksWithNSURI(AddressingConstants.Submission.WSA_NAMESPACE);

            if (addressingHeaders != null && addressingHeaders.size() != 0) {
                detachAddressingInformation(addressingHeaders);

            } else {
                addressingHeaders =
                    soapHeader.getHeaderBlocksWithNSURI(AddressingConstants.Final.WSA_NAMESPACE);
                if (addressingHeaders != null && addressingHeaders.size() != 0) {
                    detachAddressingInformation(addressingHeaders);
                }
            }
        }
View Full Code Here


     * @return the resulting SOAPEnvelope
     */
    public static SOAPEnvelope removeAddressingHeaders(MessageContext axisMsgCtx) {

        SOAPEnvelope env = axisMsgCtx.getEnvelope();
        SOAPHeader soapHeader = env.getHeader();
        ArrayList addressingHeaders;

        if (soapHeader != null) {
            addressingHeaders = soapHeader.getHeaderBlocksWithNSURI(
                AddressingConstants.Submission.WSA_NAMESPACE);

            if (addressingHeaders != null && addressingHeaders.size() != 0) {
                detachAddressingInformation(addressingHeaders);

            } else {
                addressingHeaders = soapHeader.getHeaderBlocksWithNSURI(
                    AddressingConstants.Final.WSA_NAMESPACE);
                if (addressingHeaders != null && addressingHeaders.size() != 0) {
                    detachAddressingInformation(addressingHeaders);
                }
            }
View Full Code Here

        if (getReplyTo() != null)
            sb.append(separator + "ReplyTo: " + getReplyTo().getAddress());
        if (getMessageID() != null)
            sb.append(separator + "MessageID: " + getMessageID());

        SOAPHeader soapHeader = getEnvelope().getHeader();
        if (soapHeader != null) {
            sb.append(separator + "Headers : ");
            for (Iterator iter = soapHeader.examineAllHeaderBlocks(); iter.hasNext();) {
                Object o = iter.next();
                if (o instanceof SOAPHeaderBlock) {
                    SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) o;
                    sb.append(separator + headerBlock.getLocalName() + " : " + headerBlock.getText());
                } else if (o instanceof OMElement) {
View Full Code Here

     */
    private Map sessionMap = Collections.synchronizedMap(new HashMap());

    public Endpoint getEndpoint(MessageContext synCtx) {

        SOAPHeader header = synCtx.getEnvelope().getHeader();

        if(header != null) {
            OMElement csID = header.getFirstChildWithName(
                    new QName("http://ws.apache.org/namespaces/synapse", "ClientID", "syn"));
            if(csID != null && csID.getText() != null) {
                Object o = sessionMap.get(csID.getText());
                if (o != null) {
                    return (Endpoint) o;
View Full Code Here

        return null;
    }

    public void updateSession(MessageContext synCtx, Endpoint endpoint) {

        SOAPHeader header = synCtx.getEnvelope().getHeader();

        if(header != null) {
            OMElement csID = header.getFirstChildWithName(
                    new QName("http://ws.apache.org/namespaces/synapse", "ClientID", "syn"));
            if(csID != null && csID.getText() != null) {
                // synchronized to avoid possible replacement of sessions
                synchronized(sessionMap) {
                    if (!sessionMap.containsKey(csID.getText())) {
View Full Code Here

        }
    }

    public void unbind(MessageContext synCtx) {

        SOAPHeader header = synCtx.getEnvelope().getHeader();

        if(header != null) {
            OMElement csID = header.getFirstChildWithName(
                    new QName("http://ws.apache.org/namespaces/synapse", "ClientID", "syn"));
            if(csID != null && csID.getText() != null) {
                sessionMap.remove(csID.getText());
            }
        }
View Full Code Here

     * an Endpoint could not be found for the session.
     */
    public Endpoint getEndpoint(MessageContext synCtx) {
        Endpoint endpoint = null;

        SOAPHeader header = synCtx.getEnvelope().getHeader();

        if(header != null) {
            OMElement sgcID = header.getFirstChildWithName(
                    new QName("http://ws.apache.org/namespaces/axis2", "ServiceGroupId", "axis2"));

            if(sgcID != null && sgcID.getText() != null) {

                Object e = sessionMap.get(sgcID.getText());
View Full Code Here

        // get the service group context id
        // check if service group context id is a key of any entry
        // if not, add an entry <service group context id, endpoint>


        SOAPHeader header = synCtx.getEnvelope().getHeader();

        if(header != null) {
            OMElement replyTo = header.getFirstChildWithName
                    (new QName("http://www.w3.org/2005/08/addressing", "ReplyTo", "wsa"));

            if(replyTo != null) {
                OMElement referenceParameters = replyTo.getFirstChildWithName(new QName(
                        "http://www.w3.org/2005/08/addressing", "ReferenceParameters", "wsa"));
View Full Code Here

        }
    }

    public void unbind(MessageContext synCtx) {

        SOAPHeader header = synCtx.getEnvelope().getHeader();

        if(header != null) {
            OMElement sgcID = header.getFirstChildWithName(
                    new QName("http://ws.apache.org/namespaces/axis2", "ServiceGroupId", "axis2"));
            if(sgcID != null && sgcID.getText() != null) {
                sessionMap.remove(sgcID.getText());
            }
        }
View Full Code Here

                } else if (SynapseConstants.HEADER_REPLY_TO.equals(qName.getLocalPart())) {
                    synCtx.setReplyTo(null);
                } else {
                    SOAPEnvelope envelope = synCtx.getEnvelope();
                    if (envelope != null) {
                        SOAPHeader header = envelope.getHeader();
                        if (header != null) {
                            removeFromHeaderList(header.
                                getHeaderBlocksWithNSURI(""));
                        }
                    }
                }

            } else {
                SOAPEnvelope envelope = synCtx.getEnvelope();
                if (envelope != null) {
                    SOAPHeader header = envelope.getHeader();
                    if (header != null) {
                        removeFromHeaderList(header.
                            getHeaderBlocksWithNSURI(qName.getNamespaceURI()));
                    }
                }
            }
        }
View Full Code Here

TOP

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

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.