Examples of OMDocument


Examples of org.apache.axiom.om.OMDocument

      String resourcePath, Map<String, ParamValue> params,
      String accessMethod) throws DataServiceFault {   
    OMElement result = (new SingleDataServiceRequest(dataService, Resource
        .generateRequestName(resourcePath, accessMethod),
        params)).dispatch();
    OMDocument doc = OMAbstractFactory.getOMFactory().createOMDocument();
    doc.addChild(result);
    return doc.getOMDocumentElement();
  }
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

                new QName(DBConstants.EventNotification.CONTENT));
        contentEl.addChild(data);
        result.addChild(contentEl);
        /* clone required, or else the content in 'content' element is missing in result */
        result = result.cloneOMElement();
        OMDocument doc = fac.createOMDocument();
        doc.addChild(result);
        return doc.getOMDocumentElement();
    }
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

        queryLevel, prefetchData, prefetchedData);
  }
 
  private OMElement createOMElementFromInputParams(InternalParamCollection params) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMDocument doc = fac.createOMDocument();
    OMElement retEl = fac.createOMElement(new QName(this.getQueryId()));
    OMElement scalarEl;
    List<OMElement> arrayEl;
    ParamValue paramValue;
    for (InternalParam param : params.getParams()) {
      paramValue = param.getValue();
      if (paramValue.getValueType() == ParamValue.PARAM_VALUE_SCALAR ||
          paramValue.getValueType() == ParamValue.PARAM_VALUE_UDT) {
        scalarEl = fac.createOMElement(new QName(param.getName()));
        scalarEl.setText(paramValue.getScalarValue());
        retEl.addChild(scalarEl);
      } else if (paramValue.getValueType() == ParamValue.PARAM_VALUE_ARRAY) {
        arrayEl = this.createOMElementsFromArrayValue(param.getName(), paramValue, fac);
        for (OMElement el : arrayEl) {
          retEl.addChild(el);
        }
      }
    }
    doc.addChild(retEl);
    return doc.getOMDocumentElement();
  }
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

        synCtx.setConfiguration(testConfig);
        synCtx.setEnvironment(new Axis2SynapseEnvironment(
                new ConfigurationContext(new AxisConfiguration()), testConfig));

        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

            }
        }
        synCtx.setConfiguration(testConfig);

        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

            }
        }
        synCtx.setConfiguration(testConfig);

        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

            }
        }
        synCtx.setConfiguration(testConfig);

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

        //XMLStreamReader parser = XMLInputFactory.newInstance().
        //        createXMLStreamReader(new FileReader(path));
        StAXOMBuilder builder = new StAXOMBuilder(path);
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

                                     XMLStreamWriter writer)
    throws XMLStreamException {
        StAXOMBuilder builder = new StAXOMBuilder(reader);
        builder.releaseParserOnClose(true);
        try {
            OMDocument omDocument = builder.getDocument();
            Iterator it = omDocument.getChildren();
            while (it.hasNext()) {
                OMNode omNode = (OMNode) it.next();
                omNode.serializeAndConsume(writer);
            }
        } finally {
View Full Code Here

Examples of org.apache.axiom.om.OMDocument

    private static void reader2writer(XMLStreamReader reader,
                                     XMLStreamWriter writer) throws XMLStreamException {
        StAXOMBuilder builder = new StAXOMBuilder(reader);
        builder.releaseParserOnClose(true);
        try {
            OMDocument omDocument = builder.getDocument();
            Iterator it = omDocument.getChildren();
            while (it.hasNext()) {
                OMNode omNode = (OMNode) it.next();
                omNode.serializeAndConsume(writer);
            }
        } finally {
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.