Examples of OMNamespace


Examples of org.apache.axiom.om.OMNamespace

public class OMChildrenWithSpecificAttributeIteratorTest extends TestCase {
    public void testChildrenRetrievalWithDetaching() {

        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMNamespace testNamespace = factory.createOMNamespace("http://test.ws.org", "test");
        OMElement documentElement = getSampleDocumentElement(testNamespace);

        Iterator childrenIter = new OMChildrenWithSpecificAttributeIterator(
                documentElement.getFirstOMChild(),
                new QName(testNamespace.getNamespaceURI(), "myAttr",
                          testNamespace.getPrefix()), "Axis2", true);

        int childCount = getChidrenCount(childrenIter);
        assertEquals("Iterator must return 5 children with the given attribute", childCount, 5);

        Iterator children = documentElement.getChildren();
View Full Code Here

Examples of org.apache.axis2.om.OMNamespace

  public static SOAPEnvelope getRequestEnvelope(String operationName,
      int param1, int param2, String groupContextId) {
    SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
    SOAPEnvelope envelope = fac.getDefaultEnvelope();
    OMNamespace namespace = fac.createOMNamespace(
        "http://axis2/test/namespace1", "ns1");

    OMElement params = fac.createOMElement(operationName, namespace);
    OMElement param1OM = fac.createOMElement("param1", namespace);
    OMElement param2OM = fac.createOMElement("param2", namespace);
    param1OM.setText(Integer.toString(param1));
    param2OM.setText(Integer.toString(param2));
    params.addChild(param1OM);
    params.addChild(param2OM);
    envelope.getBody().setFirstChild(params);

    if (groupContextId != null) {
      OMNamespace axis2Namespace = fac.createOMNamespace(
          Constants.AXIS2_NAMESPACE_URI,
          Constants.AXIS2_NAMESPACE_PREFIX);
      SOAPHeaderBlock soapHeaderBlock = envelope.getHeader()
          .addHeaderBlock(Constants.SERVICE_GROUP_ID, axis2Namespace);
      soapHeaderBlock.setText(groupContextId);
View Full Code Here

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

    private OMElement createEnvelope(String fileName) throws Exception {

        DataHandler expectedDH;
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace("http://example.org/mtom/data", "x");
        OMElement data = fac.createOMElement("Data", omNs);

        File dataFile = new File(fileName);
        FileDataSource dataSource = new FileDataSource(dataFile);
        expectedDH = new DataHandler(dataSource);
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.