Package org.apache.ws.commons.om

Examples of org.apache.ws.commons.om.OMException


            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


        serializeAndConsume(omOutput);
        omOutput.flush();
    }

    public OMNode detach() {
        throw new OMException(
                "Elements that doesn't have a parent can not be detached");
    }
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

    }

    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,
                    (SOAPFactory)this.factory);
        } catch (SOAPProcessingException e) {
            throw new OMException(e);
        }
        ((OMNodeEx)soapHeaderBlock).setComplete(true);
        return soapHeaderBlock;
    }
View Full Code Here

                if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
                    Attr attr = (Attr) node;
                    TestCase.assertEquals(attr.getValue(),
                            omattribute.getAttributeValue());
                } else {
                    throw new OMException("return type is not a Attribute");
                }

            }
            Iterator it = omele.getChildren();
            NodeList list = ele.getChildNodes();
View Full Code Here

      if(child instanceof OMElement) {
        if(this.documentElement == null) {
          addChild((OMNodeImpl) child);
          this.documentElement = (OMElement)child;
        } else {
          throw new OMException("Document element already exists");
        }
      } else {
        addChild((OMNodeImpl) child);
      }
    }
View Full Code Here

        super(envelope, builder, factory);
    }

    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,
                    (SOAPFactory) this.factory);
        } catch (SOAPProcessingException e) {
            throw new OMException(e);
        }
        ((OMNodeEx) soapHeaderBlock).setComplete(true);
        return soapHeaderBlock;
    }
View Full Code Here

TOP

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