Package org.apache.axis2.om

Examples of org.apache.axis2.om.OMException


  }

  public Object fromOMElement(OMElement body) throws OMException {

    if (!(body instanceof SOAPBody))
      throw new OMException(
          "Cant add terminate sequence to a non body element");

    OMElement terminateSeqPart = body.getFirstChildWithName(new QName(
        Sandesha2Constants.WSRM.NS_URI_RM, Sandesha2Constants.WSRM.TERMINATE_SEQUENCE));

    if (terminateSeqPart == null)
      throw new OMException(
          "passed element does not contain a terminate sequence part");

    identifier = new Identifier(factory);
    identifier.fromOMElement(terminateSeqPart);
View Full Code Here


  }

  public OMElement toOMElement(OMElement body) throws OMException {

    if (body == null || !(body instanceof SOAPBody))
      throw new OMException(
          "Cant add terminate sequence to a nonbody element");

    if (terminateSequenceElement == null)
      throw new OMException(
          "Cant add terminate sequnce since the internal element is null");

    if (identifier == null)
      throw new OMException(
          "Cant add terminate sequence since identifier is not set");

    identifier.toOMElement(terminateSequenceElement);
    body.addChild(terminateSequenceElement);
View Full Code Here

  }

  public Object fromOMElement(OMElement header) throws OMException {

    if (header == null || !(header instanceof SOAPHeader))
      throw new OMException(
          "Cant add the Ack Requested part to a non-header element");

    OMElement ackReqPart = header.getFirstChildWithName(new QName(
        Sandesha2Constants.WSRM.NS_URI_RM, Sandesha2Constants.WSRM.ACK_REQUESTED));

    if (ackReqPart == null)
      throw new OMException(
          "the passed element does not contain an ack requested part");

    identifier = new Identifier(factory);
    identifier.fromOMElement(ackReqPart);
View Full Code Here

  }

  public OMElement toOMElement(OMElement header) throws OMException {

    if (header == null || !(header instanceof SOAPHeader))
      throw new OMException(
          "Cant add the Ack Requested part to a non-header element");

    if (identifier == null)
      throw new OMException(
          "Cant add ack Req block since the identifier is null");

    SOAPHeader SOAPHdr = (SOAPHeader) header;
    SOAPHeaderBlock ackReqHdrBlock = SOAPHdr.addHeaderBlock(
        Sandesha2Constants.WSRM.ACK_REQUESTED, rmNamespace);
View Full Code Here

  public Object fromOMElement(OMElement element) throws OMException {
    OMElement expiresPart = element.getFirstChildWithName(new QName(
        Sandesha2Constants.WSRM.NS_URI_RM, Sandesha2Constants.WSRM.EXPIRES));
    if (expiresPart == null)
      throw new OMException(
          "Passed elemenet does not have a Expires part");
    String expiresText = expiresPart.getText();
    if (expiresText == null || expiresText == "")
      throw new OMException("The duration value is not valid");

    expiresElement = factory.createOMElement(
        Sandesha2Constants.WSRM.EXPIRES, rmNamespace);

    duration = expiresText;
View Full Code Here

    return expiresElement;
  }

  public OMElement toOMElement(OMElement element) throws OMException {
    if (expiresElement == null)
      throw new OMException("Cant set Expires. It is null");
    if (duration == null || duration == "")
      throw new OMException(
          "Cant set Expires. The duration value is not set");

    expiresElement.setText(duration);
    element.addChild(expiresElement);
View Full Code Here

  }

  public Object fromOMElement(OMElement sequenceFault) throws OMException {

    if (sequenceFault == null)
      throw new OMException(
          "Can't add Fault Code part since the passed element is null");

    OMElement faultCodePart = sequenceFault
        .getFirstChildWithName(new QName(Sandesha2Constants.WSRM.NS_PREFIX_RM,
            Sandesha2Constants.WSRM.FAULT_CODE));

    if (faultCodePart == null)
      throw new OMException(
          "Passed element does not contain a Fauld Code part");

    this.faultCode = faultCodePart.getText();

    faultCodeElement = factory.createOMElement(
View Full Code Here

  }

  public OMElement toOMElement(OMElement sequenceFault) throws OMException {

    if (sequenceFault == null)
      throw new OMException(
          "Can't add Fault Code part since the passed element is null");

    if (faultCode == null || faultCode == "")
      throw new OMException(
          "Cant add fault code since the the value is not set correctly.");

    if (faultCodeElement == null)
      throw new OMException(
          "Cant add the fault code since the internal element is null");

    faultCodeElement.setText(faultCode);
    sequenceFault.addChild(faultCodeElement);
View Full Code Here

      throws OMException {
    OMElement sequenceOfferPart = createSequenceElement
        .getFirstChildWithName(new QName(Sandesha2Constants.WSRM.NS_URI_RM,
            Sandesha2Constants.WSRM.SEQUENCE_OFFER));
    if (sequenceOfferPart == null)
      throw new OMException(
          "The passed element does not contain a SequenceOffer part");

    sequenceOfferElement = factory.createOMElement(
        Sandesha2Constants.WSRM.SEQUENCE_OFFER, rmNamespace);
View Full Code Here

  }

  public OMElement toOMElement(OMElement createSequenceElement)
      throws OMException {
    if (sequenceOfferElement == null)
      throw new OMException(
          "Cant set sequnceoffer. Offer element is null");
    if (identifier == null)
      throw new OMException(
          "Cant set sequnceOffer since identifier is null");

    identifier.toOMElement(sequenceOfferElement);

    if (expires != null) {
View Full Code Here

TOP

Related Classes of org.apache.axis2.om.OMException

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.