Package org.apache.axis2.om

Examples of org.apache.axis2.om.OMException


            if(!parser.hasNext()) {
                done = true;
                ((OMNodeEx)body).setComplete(true);
            }
        } catch (XMLStreamException e) {
            throw new OMException(e);
        }
        return ret;
    }
View Full Code Here


     *
     * @throws OMException
     */
    public void addFault(SOAPFault soapFault) throws OMException {
        if (hasSOAPFault) {
            throw new OMException(
                    "SOAP Body already has a SOAP Fault and there can not be more than one SOAP fault");
        }
        addChild(soapFault);
        hasSOAPFault = true;
    }
View Full Code Here

     *
     * Overriding the default behaviour as a SOAPMessage
     *  should not have a DTD
     */
    protected OMNode createDTD() throws OMException {
      throw new OMException("SOAP message MUST NOT contain a Document Type Declaration(DTD)");
    }
View Full Code Here

     *
     * Overriding the default behaviour as a SOAP Message
     * should not have a PI
     */
    protected OMNode createPI() throws OMException {
      throw new OMException("SOAP message MUST NOT contain Processing Instructions(PI)");
    }
View Full Code Here

        super(envelope, builder);
    }

    public SOAPHeaderBlock addHeaderBlock(String localName, OMNamespace ns) throws OMException {
        if (ns == null || ns.getName() == null || "".equals(ns.getName())) {
            throw new OMException(
                    "All the SOAP Header blocks should be namespace qualified");
        }

        OMNamespace namespace = findNamespace(ns.getName(), ns.getPrefix());
        if (namespace != null) {
            ns = namespace;
        }

        SOAPHeaderBlock soapHeaderBlock = null;
        try {
            soapHeaderBlock = new SOAP11HeaderBlockImpl(localName, ns, this);
        } catch (SOAPProcessingException e) {
            throw new OMException(e);
        }
        ((OMNodeEx)soapHeaderBlock).setComplete(true);
        return soapHeaderBlock;
    }
View Full Code Here

        super(envelope, builder);
    }

    public SOAPHeaderBlock addHeaderBlock(String localName, OMNamespace ns) throws OMException {
        if (ns == null || ns.getName() == null || "".equals(ns.getName())) {
            throw new OMException(
                    "All the SOAP Header blocks should be namespace qualified");
        }

        OMNamespace namespace = findNamespace(ns.getName(), ns.getPrefix());
        if (namespace != null) {
            ns = namespace;
        }

        SOAPHeaderBlock soapHeaderBlock = null;
        try {
            soapHeaderBlock = new SOAP12HeaderBlockImpl(localName, ns, this);
        } catch (SOAPProcessingException e) {
            throw new OMException(e);
        }
        ((OMNodeEx)soapHeaderBlock).setComplete(true);
        return soapHeaderBlock;
    }
View Full Code Here

                  }

                } while (inStream.available() > 0);
                return text.toString();
            } catch (Exception e) {
                throw new OMException(e);
            }
        }
    }
View Full Code Here

            InputStream inStream;
            javax.activation.DataHandler dataHandler = (javax.activation.DataHandler)dataHandlerObject;
            try {
                inStream = dataHandler.getDataSource().getInputStream();
            } catch (IOException e) {
                throw new OMException(
                        "Cannot get InputStream from DataHandler." + e);
            }
            return inStream;
        } else {
            throw new OMException("Unsupported Operation");
        }
    }
View Full Code Here

     *
     * @throws OMException
     */
    public OMNode detach() throws OMException {
        if (parent == null) {
            throw new OMException(
                    "Elements that doesn't have a parent can not be detached");
        }
        OMNodeImpl nextSibling = (OMNodeImpl) getNextSibling();
        if (previousSibling == null) {
            parent.setFirstChild(nextSibling);
View Full Code Here

     *
     * @throws OMException
     */
    public void insertSiblingAfter(OMNode sibling) throws OMException {
        if (parent == null) {
            throw new OMException();
        }
        ((OMNodeEx)sibling).setParent(parent);
        if (sibling instanceof OMNodeImpl) {
            OMNodeImpl siblingImpl = (OMNodeImpl) sibling;
            if (nextSibling == 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.