Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPHeader


    if (!(headerElement instanceof SOAPHeader)) {
      String message = "'MessagePending' element can only be added to a SOAP Header";
      throw new OMException(message);
    }
   
    SOAPHeader header = (SOAPHeader) headerElement;
    OMFactory factory = header.getOMFactory();
    OMNamespace namespace = factory.createOMNamespace(namespaceValue,Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
   
    SOAPHeaderBlock headerBlock = header.addHeaderBlock(Sandesha2Constants.WSRM_COMMON.MESSAGE_PENDING,namespace);
   
    OMAttribute attribute = factory.createOMAttribute(Sandesha2Constants.WSRM_COMMON.PENDING,null,new Boolean (pending).toString());
    headerBlock.addAttribute(attribute);
   
    return headerElement;
View Full Code Here


    if (log.isDebugEnabled())
      log.debug("Enter: SandeshaUtil::removeMustUnderstand");
    // you have to explicitely set the 'processed' attribute for header
    // blocks, since it get lost in the above read from the stream.

    SOAPHeader header = envelope.getHeader();
    if (header != null) {
      Iterator childrenOfOldEnv = header.getChildElements();
      while (childrenOfOldEnv.hasNext()) {
       
        SOAPHeaderBlock oldEnvHeaderBlock = (SOAPHeaderBlock) childrenOfOldEnv.next();

        QName oldEnvHeaderBlockQName = oldEnvHeaderBlock.getQName();
View Full Code Here

    SOAPEnvelope clonedEnvelope = new StAXSOAPModelBuilder(streamReader, null).getSOAPEnvelope();

    // you have to explicitely set the 'processed' attribute for header
    // blocks, since it get lost in the above read from the stream.

    SOAPHeader header = envelope.getHeader();
    if (header != null) {
      Iterator childrenOfOldEnv = header.getChildElements();
      Iterator childrenOfNewEnv = clonedEnvelope.getHeader().getChildElements();
      while (childrenOfOldEnv.hasNext()) {
       
        SOAPHeaderBlock oldEnvHeaderBlock = (SOAPHeaderBlock) childrenOfOldEnv.next();
        SOAPHeaderBlock newEnvHeaderBlock = (SOAPHeaderBlock) childrenOfNewEnv.next();
View Full Code Here

      if (oldAckIdentifier!=null && oldAckIdentifier.equals(this.identifier.getIdentifier())) {
        oldAckElement.detach();
      }
    }
   
    SOAPHeader SOAPHeader = (SOAPHeader) header;
    SOAPHeaderBlock sequenceAcknowledgementHeaderBlock = SOAPHeader.addHeaderBlock(
        Sandesha2Constants.WSRM_COMMON.SEQUENCE_ACK,rmNamespace);
   
    if (sequenceAcknowledgementHeaderBlock == null)
      throw new OMException("Cant set sequence acknowledgement since the element is null");
View Full Code Here

  public List getNackList() {
    return nackList;
  }

  public void toSOAPEnvelope(SOAPEnvelope envelope) throws SandeshaException {
    SOAPHeader header = envelope.getHeader();
   
    if (header==null) {
      SOAPFactory factory = (SOAPFactory)envelope.getOMFactory();
      header = factory.createSOAPHeader(envelope);
    }
View Full Code Here

    return namespaceValue;
  }

  public Object fromOMElement(OMElement headerElement) throws OMException,SandeshaException {

    SOAPHeader header = (SOAPHeader) headerElement;
    if (header == null)
      throw new OMException(
          SandeshaMessageHelper.getMessage(
              SandeshaMessageKeys.seqElementCannotBeAddedToNonHeader));
View Full Code Here

    if (headerElement == null || !(headerElement instanceof SOAPHeader))
      throw new OMException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.seqElementCannotBeAddedToNonHeader));

    SOAPHeader soapHeader = (SOAPHeader) headerElement;

    if (identifier == null)
      throw new OMException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.nullMsgId));
    if (messageNumber == null)
      throw new OMException(SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.seqPartIsNull));

    OMFactory factory = headerElement.getOMFactory();

    OMNamespace rmNamespace = factory.createOMNamespace(
        namespaceValue, Sandesha2Constants.WSRM_COMMON.NS_PREFIX_RM);
    SOAPHeaderBlock sequenceHeaderBlock = soapHeader.addHeaderBlock(
        Sandesha2Constants.WSRM_COMMON.SEQUENCE, rmNamespace);
   
    // Always set the MustUnderstand to true for Sequence messages
    sequenceHeaderBlock.setMustUnderstand(true);
    identifier.toOMElement(sequenceHeaderBlock);
View Full Code Here

  public void setMessageNumber(MessageNumber messageNumber) {
    this.messageNumber = messageNumber;
  }

  public void toSOAPEnvelope(SOAPEnvelope envelope) {
    SOAPHeader header = envelope.getHeader();
   
    if (header==null) {
      SOAPFactory factory = (SOAPFactory)envelope.getOMFactory();
      header = factory.createSOAPHeader(envelope);
    }
   
    //detach if already exist.
    OMElement elem = header.getFirstChildWithName(new QName(namespaceValue,
        Sandesha2Constants.WSRM_COMMON.SEQUENCE));
    if (elem!=null)
      elem.detach();
   
    toOMElement(header);
View Full Code Here

    if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled())
      log.debug("Enter: SandeshaUtil::removeMustUnderstand");
    // you have to explicitely set the 'processed' attribute for header
    // blocks, since it get lost in the above read from the stream.

    SOAPHeader header = envelope.getHeader();
    if (header != null) {
      Iterator childrenOfOldEnv = header.getChildElements();
      while (childrenOfOldEnv.hasNext()) {
       
        SOAPHeaderBlock oldEnvHeaderBlock = (SOAPHeaderBlock) childrenOfOldEnv.next();

        QName oldEnvHeaderBlockQName = oldEnvHeaderBlock.getQName();
View Full Code Here

     *
     * @param envelope the SOAPEnvelope in which to write the headers
     */
    public void addHeadersToEnvelope(SOAPEnvelope envelope) {
        if (headers != null) {
            SOAPHeader soapHeader = envelope.getHeader();
            for (Object header : headers) {
                soapHeader.addChild((OMElement)header);
            }
        }
    }
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.