Package org.apache.axis2.soap

Examples of org.apache.axis2.soap.SOAPHeader


    private static final long serialVersionUID = 3907988439637261572L;

  public void invoke(MessageContext msgContext) throws AxisFault {
        logger.debug("Starting Addressing IN Handler .........");
        SOAPHeader header = msgContext.getEnvelope().getHeader();
        if (header == null) {
            return;
        }

        ArrayList addressingHeaders;
        try {
            addressingHeaders = header.getHeaderBlocksWithNSURI(Submission.WSA_NAMESPACE);
            if (addressingHeaders != null) {
                addressingNamespace = Submission.WSA_NAMESPACE;
                extractCommonAddressingParameters(
                        header,
                        msgContext.getOptions(),
                        addressingHeaders, Submission.WSA_NAMESPACE);
            } else {
                addressingHeaders = header.getHeaderBlocksWithNSURI(Final.WSA_NAMESPACE);
                if (addressingHeaders != null) {
                    addressingNamespace = Final.WSA_NAMESPACE;
                    extractCommonAddressingParameters(
                            header,
                            msgContext.getOptions(),
View Full Code Here


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

            SOAPHeader header = ((SOAPEnvelope) omBuilder.getDocumentElement()).getHeader();
            Options options =
                    inHandler.extractCommonAddressingParameters(header,
                            new Options(),
                            header.getHeaderBlocksWithNSURI(
                                    AddressingConstants.Submission.WSA_NAMESPACE),
                            AddressingConstants.Submission.WSA_NAMESPACE);

            if (options == null) {
                fail(
View Full Code Here

    public void testWSAFinalInformation() {
        try {
            StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder(
                    wsaFinalTestFile);
            inHandler.addressingNamespace = AddressingConstants.Final.WSA_NAMESPACE;
            SOAPHeader header = ((SOAPEnvelope) omBuilder.getDocumentElement()).getHeader();
            Options options =
                    inHandler.extractCommonAddressingParameters(header,
                            new Options(),
                            header.getHeaderBlocksWithNSURI(
                                    AddressingConstants.Final.WSA_NAMESPACE),
                            AddressingConstants.Final.WSA_NAMESPACE);
            assertNotNull(options);
            assertNotNull(options.getTo());
View Full Code Here

     *                     the <CODE>SOAPHeader</CODE>
     *                     object
     * @throws OMException
     */
    public SOAPHeader getHeader() throws OMException {
        SOAPHeader header =
                (SOAPHeader) getFirstChildWithName(
                        new QName(SOAPConstants.HEADER_LOCAL_NAME));
        if (builder == null && header == null) {
            inferFactory();
            header = factory.createSOAPHeader(this);
View Full Code Here

    }

    private void parseHeaders() {
        // by the time execution comes here the nullity of SOAPEnvelope has been cheched in the
        // identifySOAPVersion() method. So not checking getSOAPEnvelope() == null here
        SOAPHeader soapHeader = getSOAPEnvelope().getHeader();

        if (soapHeader != null) {
            while (!soapHeader.isComplete()) {
                next();
            }
        } else {
            log.info("No SOAPHeaders present !!");
        }
View Full Code Here

        SOAPEnvelope se = sf.getDefaultEnvelope();
        if (elem != null) {
            se.getBody().addChild(elem);
        }
        if (headers != null) {
            SOAPHeader sh = se.getHeader();
            for (int i = 0; i < headers.size(); i++) {
                sh.addChild((OMElement) headers.get(i));
            }
        }
        mc.setEnvelope(se);
    }
View Full Code Here

    protected void addUserAddedSOAPHeaders(MessageContext msgCtx, Options options) {
        if ((soapHeaderList != null) && (soapHeaderList.size() > 0)
            && (msgCtx.getEnvelope() != null)) {
            SOAPFactory soapFactory;
            SOAPHeader header = msgCtx.getEnvelope().getHeader();

            if (header == null) {
                soapFactory = getCorrectSOAPFactory(msgCtx);
                header = soapFactory.createSOAPHeader(msgCtx.getEnvelope());
            }

            if (!header.isComplete()) {
                header.build();
            }

            for (int i = 0; i < soapHeaderList.size(); i++) {
                OMElement headerBlock = (OMElement) soapHeaderList.get(i);

                header.addChild(headerBlock);
            }
        }
    }
View Full Code Here

    if (envelope == null)
      throw new SandeshaException("SOAP Envelope is null");

    RMMsgContext faultMessageContext = null;

    SOAPHeader header = envelope.getHeader();
    if (header != null) {
      OMElement sequenceHeaderBlock = header
          .getFirstChildWithName(new QName(Sandesha2Constants.WSRM.NS_URI_RM,
              Sandesha2Constants.WSRM.SEQUENCE));
      if (sequenceHeaderBlock != null) {
        faultMessageContext = checkForMessageNumberRoleover(msgCtx);
        if (faultMessageContext != null)
View Full Code Here

  public static boolean isRMGlobalMessage(MessageContext msgCtx) {
    boolean rmGlobalMsg = false;

    String action = msgCtx.getWSAAction();
    SOAPEnvelope env = msgCtx.getEnvelope();
    SOAPHeader header = null;
    if (env != null)
      header = env.getHeader();

    OMElement sequenceElem = null;
    if (header != null)
      sequenceElem = header.getFirstChildWithName(new QName(
          Sandesha2Constants.WSRM.NS_URI_RM, Sandesha2Constants.WSRM.SEQUENCE));

    if (sequenceElem != null)
      rmGlobalMsg = true;
View Full Code Here

    if (element == null || !(element instanceof SOAPHeader))
      throw new OMException(
          "Cant get sequence acknowlegement from a non-header element");

    SOAPHeader header = (SOAPHeader) element;
    OMElement sequenceAckPart = header.getFirstChildWithName(new QName(
        Sandesha2Constants.WSRM.NS_URI_RM, Sandesha2Constants.WSRM.SEQUENCE_ACK));

    if (sequenceAckPart == null)
      throw new OMException(
          "The passed element does not contain a seqence ackknowledgement Part");
View Full Code Here

TOP

Related Classes of org.apache.axis2.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.