Package org.apache.axis2.om

Examples of org.apache.axis2.om.OMException


    return this;
  }
 
  public OMElement toOMElement(OMElement sequenceAckElement) throws OMException {
    if (sequenceAckElement==null)
      throw new OMException ("Cant set the nack part since the seq ack element is null");
   
    if (nackNumber<=0)
      throw new OMException ("Cant set the nack part since the nack number does not have a valid value");
   
    if (nackElement==null)
        throw new OMException ("Cant set the nack part since the element is null");
   
    nackElement.setText(Long.toString(nackNumber));
    sequenceAckElement.addChild(nackElement);

    nackElement = factory.createOMElement(
View Full Code Here


  public Object fromOMElement(OMElement element) throws OMException {

    OMElement addressPart = element.getFirstChildWithName(new QName(
        Sandesha2Constants.WSA.NS_URI_ADDRESSING, Sandesha2Constants.WSA.ADDRESS));
    if (addressPart == null)
      throw new OMException(
          "Cant find an Address element in the given part");
    String addressText = addressPart.getText();
    if (addressText == null || addressText == "")
      throw new OMException(
          "Passed element does not have a valid address text");

    addressElement = addressPart;
    epr = new EndpointReference(addressText);
    addressElement = factory.createOMElement(
View Full Code Here

    return addressElement;
  }

  public OMElement toOMElement(OMElement element) throws OMException {
    if (addressElement == null)
      throw new OMException(
          "Cant set Address. The address element is null");

    if (epr == null || epr.getAddress() == null || epr.getAddress() == "")
      throw new OMException(
          "cant set the address. The address value is not valid");

    addressElement.setText(epr.getAddress());
    element.addChild(addressElement);
View Full Code Here

 
  public Object fromOMElement(OMElement seqenceElement) throws OMException {
    OMElement msgNumberPart = seqenceElement.getFirstChildWithName(
        new QName (Sandesha2Constants.WSRM.NS_URI_RM,Sandesha2Constants.WSRM.MSG_NUMBER));
    if (msgNumberPart==null)
      throw new OMException ("The passed sequnce element does not contain a message number part");
   
    messageNoElement = factory.createOMElement(Sandesha2Constants.WSRM.MSG_NUMBER,rmNamespace);

    String msgNoStr = msgNumberPart.getText();
    messageNumber = Long.parseLong(msgNoStr);
View Full Code Here

    return this;
  }
 
  public OMElement toOMElement(OMElement element) throws OMException {
    if (messageNumber <= 0 ){
      throw new OMException("Set A Valid Message Number");
    }
   
    messageNoElement.setText(Long.toString(messageNumber));
    element.addChild(messageNoElement);
   
View Full Code Here

  public Object fromOMElement(OMElement element) throws OMException {
    OMElement acksToPart = element.getFirstChildWithName(new QName(
        Sandesha2Constants.WSRM.NS_URI_RM, Sandesha2Constants.WSRM.ACKS_TO));

    if (acksToPart == null)
      throw new OMException(
          "Passed element does not contain an acksTo part");

    address = new Address(factory);
    address.fromOMElement(acksToPart);
View Full Code Here

  }

  public OMElement toOMElement(OMElement element) throws OMException {

    if (acksToElement == null)
      throw new OMException("Cant set AcksTo. AcksTo element is null");
    if (address == null)
      throw new OMException("Cant set AcksTo. Address is null");

    OMElement acksToPart = element.getFirstChildWithName(new QName(
        Sandesha2Constants.WSA.NS_URI_ADDRESSING, Sandesha2Constants.WSRM.ACKS_TO));

    address.toOMElement(acksToElement);
View Full Code Here

  }

  public Object fromOMElement(OMElement bodyElement) throws OMException {

    if (bodyElement == null || !(bodyElement instanceof SOAPBody))
      throw new OMException(
          "Cant get create sequnce response from a non-body element");

    SOAPBody SOAPBody = (SOAPBody) bodyElement;

    OMElement createSeqResponsePart = SOAPBody
        .getFirstChildWithName(new QName(Sandesha2Constants.WSRM.NS_URI_RM,
            Sandesha2Constants.WSRM.CREATE_SEQUENCE_RESPONSE));
    if (createSeqResponsePart == null)
      throw new OMException(
          "The passed element does not contain a create seqence response part");

    createSequenceResponseElement = factory.createOMElement(
        Sandesha2Constants.WSRM.CREATE_SEQUENCE_RESPONSE,
        createSeqResNoNamespace);
View Full Code Here

  }

  public OMElement toOMElement(OMElement bodyElement) throws OMException {

    if (bodyElement == null || !(bodyElement instanceof SOAPBody))
      throw new OMException(
          "Cant get create sequnce response from a non-body element");

    SOAPBody SOAPBody = (SOAPBody) bodyElement;

    if (createSequenceResponseElement == null)
      throw new OMException(
          "cant set create sequnce response since the internal element is not set");
    if (identifier == null)
      throw new OMException(
          "cant set create sequnce response since the Identifier is not set");

    identifier.toOMElement(createSequenceResponseElement);

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

  public Object fromOMElement(OMElement element) throws OMException {
   
    OMElement identifierPart = element.getFirstChildWithName(new QName(
        Sandesha2Constants.WSRM.NS_URI_RM, Sandesha2Constants.WSRM.IDENTIFIER));
    if (identifierPart == null)
      throw new OMException(
          "The parsed element does not contain an identifier part");
    identifierElement = factory.createOMElement(
        Sandesha2Constants.WSRM.IDENTIFIER, wsrmNamespace);

    String identifierText = identifierPart.getText();
    if (identifierText == null || identifierText == "")
      throw new OMException("The identifier value is not valid");

    identifier = identifierText;
    return this;
  }
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.