Examples of OMDocument


Examples of org.apache.axiom.om.OMDocument

        SynapseConfiguration config = new SynapseConfiguration();
        SynapseEnvironment env = new Axis2SynapseEnvironment(config);
        MessageContext synMc = new Axis2MessageContext(mc, config, env);
        SOAPEnvelope envelope =
                OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        OMDocument omDoc =
                OMAbstractFactory.getSOAP11Factory().createOMDocument();
        omDoc.addChild(envelope);

        envelope.getBody().addChild(createOMElement(payload));

        synMc.setEnvelope(envelope);
        return synMc;
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

        SynapseConfiguration config = new SynapseConfiguration();
        SynapseEnvironment env = new Axis2SynapseEnvironment(config);
        MessageContext synMc = new Axis2MessageContext(mc, config, env);
        SOAPEnvelope envelope =
                OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        OMDocument omDoc =
                OMAbstractFactory.getSOAP11Factory().createOMDocument();
        omDoc.addChild(envelope);

        envelope.getBody().addChild(createOMElement(payload));

        synMc.setEnvelope(envelope);
        return synMc;
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

  }
 
  @SuppressWarnings("unchecked")
  public Object clone() {
    Document<T> doc = ((FOMFactory)factory).newDocument();
    OMDocument omdoc = (OMDocument) doc;
    for (Iterator i = getChildren(); i.hasNext();) {
      OMNode node = (OMNode) i.next();
      switch(node.getType()) {
        case OMNode.COMMENT_NODE:
          OMComment comment = (OMComment) node;
          factory.createOMComment(omdoc, comment.getValue());
          break;
        case OMNode.DTD_NODE:
          OMDocType doctype = (OMDocType) node;
          factory.createOMDocType(omdoc, doctype.getValue());
          break;
        case OMNode.ELEMENT_NODE:
          Element el = (Element) node;
          omdoc.addChild((OMNode) el.clone());
          break;
        case OMNode.PI_NODE:
          OMProcessingInstruction pi = (OMProcessingInstruction) node;
          factory.createOMProcessingInstruction(omdoc, pi.getTarget(), pi.getValue());
          break;
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

                envelope = OMXMLBuilderFactory.createStAXSOAPModelBuilder(parser).getSOAPEnvelope();
            } else {
                envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
               
                // TODO: don't know why this is here, but without it some unit tests fail...
                OMDocument omDoc = OMAbstractFactory.getSOAP11Factory().createOMDocument();
                omDoc.addChild(envelope);
               
                SOAPBody body = envelope.getBody();
                OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(parser);
                OMElement bodyElement = builder.getDocumentElement();
                if (addTextAroundBody) {
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

        return this;
    }

    public Object clone() {
        Document<T> doc = ((FOMFactory)factory).newDocument();
        OMDocument omdoc = (OMDocument)doc;
        for (Iterator i = getChildren(); i.hasNext();) {
            OMNode node = (OMNode)i.next();
            switch (node.getType()) {
                case OMNode.COMMENT_NODE:
                    OMComment comment = (OMComment)node;
                    factory.createOMComment(omdoc, comment.getValue());
                    break;
                case OMNode.DTD_NODE:
                    OMDocType doctype = (OMDocType)node;
                    factory.createOMDocType(omdoc, doctype.getValue());
                    break;
                case OMNode.ELEMENT_NODE:
                    Element el = (Element)node;
                    omdoc.addChild((OMNode)el.clone());
                    break;
                case OMNode.PI_NODE:
                    OMProcessingInstruction pi = (OMProcessingInstruction)node;
                    factory.createOMProcessingInstruction(omdoc, pi.getTarget(), pi.getValue());
                    break;
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

        // create a test synapse context
        TestMessageContext synCtx = new TestMessageContext();

        SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        OMDocument omDoc = OMAbstractFactory.getSOAP11Factory().createOMDocument();
        omDoc.addChild(envelope);

        XMLStreamReader parser = XMLInputFactory.newInstance().
            createXMLStreamReader(new StringReader(bodyText));
        StAXOMBuilder builder = new StAXOMBuilder(parser);
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

        // create a test synapse context
        TestMessageContext synCtx = new TestMessageContext();

        SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        OMDocument omDoc = OMAbstractFactory.getSOAP11Factory().createOMDocument();
        omDoc.addChild(envelope);

        XMLStreamReader parser = XMLInputFactory.newInstance().
            createXMLStreamReader(new StringReader(bodyText));
        StAXOMBuilder builder = new StAXOMBuilder(parser);
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

        // get the correct SOAP factory to be used
        SOAPFactory factory = (
            soapVersion == SOAP11 ? OMAbstractFactory.getSOAP11Factory() : OMAbstractFactory.getSOAP12Factory());

        // create the SOAP fault document and envelope
        OMDocument soapFaultDocument = factory.createOMDocument();
        SOAPEnvelope faultEnvelope = factory.getDefaultFaultEnvelope();
        soapFaultDocument.addChild(faultEnvelope);

        // create the fault element
        SOAPFault fault = factory.createSOAPFault();

        // populate it
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

    return this;
  }
 
  public Object clone() {
    Document<T> doc = ((FOMFactory)factory).newDocument();
    OMDocument omdoc = (OMDocument) doc;
    for (Iterator i = getChildren(); i.hasNext();) {
      OMNode node = (OMNode) i.next();
      switch(node.getType()) {
        case OMNode.COMMENT_NODE:
          OMComment comment = (OMComment) node;
          factory.createOMComment(omdoc, comment.getValue());
          break;
        case OMNode.DTD_NODE:
          OMDocType doctype = (OMDocType) node;
          factory.createOMDocType(omdoc, doctype.getValue());
          break;
        case OMNode.ELEMENT_NODE:
          Element el = (Element) node;
          omdoc.addChild((OMNode) el.clone());
          break;
        case OMNode.PI_NODE:
          OMProcessingInstruction pi = (OMProcessingInstruction) node;
          factory.createOMProcessingInstruction(omdoc, pi.getTarget(), pi.getValue());
          break;
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

      String operationName, Map<String, ParamValue> params)
      throws DataServiceFault {   
    OMElement result = (new SingleDataServiceRequest(dataService, operationName,
        params)).dispatch();
    /* result must have a parent, or there are problems when it comes to XPath expressions etc.. */
    OMDocument doc = OMAbstractFactory.getOMFactory().createOMDocument();
    doc.addChild(result);
    return doc.getOMDocumentElement();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.