Package org.apache.axis2.om.impl.dom.factory

Examples of org.apache.axis2.om.impl.dom.factory.OMDOMFactory.createOMElement()


        DataHandler expectedDH;
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");

        OMElement data = fac.createOMElement("mtomSample", omNs);
        OMElement image = fac.createOMElement("image", omNs);
        Image expectedImage;
        expectedImage = new ImageIO()
                .loadImage(new FileInputStream(inputFile));

        ImageDataSource dataSource = new ImageDataSource("test.jpg",
View Full Code Here


                expectedImage);
        expectedDH = new DataHandler(dataSource);
        OMText textData = fac.createText(expectedDH, true);
        image.addChild(textData);

        OMElement imageName = fac.createOMElement("fileName", omNs);
        if (fileName != null) {
            imageName.setText(fileName);
        }
        //OMElement wrap = fac.createOMElement("wrap",omNs);
        data.addChild(image);
View Full Code Here

    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);
        OMText textData = fac.createText(expectedDH, true);
View Full Code Here

  public void testCreateElement() {
    OMDOMFactory factory = new OMDOMFactory();
    String localName = "TestLocalName";
    String namespace = "http://ws.apache.org/axis2/ns";
    String prefix = "axis2";
    OMElement elem = factory.createOMElement(localName,namespace,prefix);
    QName qname = elem.getQName();
   
    assertEquals("Localname mismatch",localName,qname.getLocalPart());
    assertEquals("Namespace mismatch",namespace,qname.getNamespaceURI());
    assertEquals("namespace prefix mismatch", prefix, qname.getPrefix());
View Full Code Here

    String localName = "TestLocalName";
    String namespace = "http://ws.apache.org/axis2/ns";
    String prefix = "axis2";
    String tempText = "The quick brown fox jumps over the lazy dog";

    OMElement elem = factory.createOMElement(localName, namespace, prefix);
    OMText textNode = factory.createText(elem, tempText);

    assertEquals("Text value mismatch", tempText, textNode.getText());
  }
View Full Code Here

    String namespace = "http://ws.apache.org/axis2/ns";
    String prefix = "axis2";
    String tempText = "The quick brown fox jumps over the lazy dog";
    String textToAppend = " followed by another fox";

    OMElement elem = factory.createOMElement(localName, namespace, prefix);
    OMText textNode = factory.createText(elem, tempText);

    ((Text) textNode).appendData(textToAppend);

    assertEquals("Text value mismatch", tempText + textToAppend, textNode
View Full Code Here

  public void testSetText() {
    OMDOMFactory factory = new OMDOMFactory();
    String localName = "TestLocalName";
    String namespace = "http://ws.apache.org/axis2/ns";
    String prefix = "axis2";
    OMElement elem = factory.createOMElement(localName,namespace,prefix);
   
    String text = "The quick brown fox jumps over the lazy dog";
   
    elem.setText(text);
   
View Full Code Here

    String namespace = "http://ws.apache.org/axis2/ns";
    String prefix = "axis2";
    String tempText = "The quick brown fox jumps over the lazy dog";
    String textToAppend = " followed by another";
   
    OMElement elem = factory.createOMElement(localName,namespace,prefix);
    OMText textNode = factory.createText(elem,tempText);
   
    ((Text)textNode).appendData(textToAppend);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try {
View Full Code Here

    String localName = "TestLocalName";
    String childLocalName = "TestChildLocalName";
    String namespace = "http://ws.apache.org/axis2/ns";
    String prefix = "axis2";
   
    OMElement elem = factory.createOMElement(localName,namespace,prefix);
    OMElement childElem = factory.createOMElement(childLocalName,namespace, prefix);
   
    elem.addChild(childElem);
   
    Iterator it = elem.getChildrenWithName(new QName(namespace, childLocalName));
View Full Code Here

    String childLocalName = "TestChildLocalName";
    String namespace = "http://ws.apache.org/axis2/ns";
    String prefix = "axis2";
   
    OMElement elem = factory.createOMElement(localName,namespace,prefix);
    OMElement childElem = factory.createOMElement(childLocalName,namespace, prefix);
   
    elem.addChild(childElem);
   
    Iterator it = elem.getChildrenWithName(new QName(namespace, childLocalName));
   
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.