Package org.apache.axis2.om

Examples of org.apache.axis2.om.OMFactory


        msgSender.setSenderTransport(Constants.TRANSPORT_MAIL);
        msgSender.send("echo", getPayload());
    }

    private static OMElement getPayload() {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace(
                "http://example1.org/example1", "example1");
        OMElement method = fac.createOMElement("echo", omNs);
        OMElement value = fac.createOMElement("Text", omNs);
        value.addChild(fac.createText(value, "Axis2 Echo String "));
        method.addChild(value);

        return method;
    }
View Full Code Here



public class ClientUtil {

    public static OMElement getEchoOMElement() {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace(
                "http://example1.org/example1", "example1");
        OMElement method = fac.createOMElement("echo", omNs);
        OMElement value = fac.createOMElement("Text", omNs);
        value.addChild(fac.createText(value, "Axis2 Echo String "));
        method.addChild(value);

        return method;
    }
View Full Code Here

        return method;
    }

    public static OMElement getPingOMElement() {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace(
                "http://example1.org/example1", "example1");
        OMElement method = fac.createOMElement("ping", omNs);
        OMElement value = fac.createOMElement("Text", omNs);
        value.addChild(fac.createText(value, "Axis2 Ping String "));
        method.addChild(value);

        return method;
    }
View Full Code Here

* Time: 1:19:11 PM
*/
public class Version {

    public OMElement getVersion() {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
        OMElement version = fac.createOMElement("Version", omNs);
        version.addChild(
                fac.createText(version,
                        "Hello I am Axis2 versionning service , My version is Axis2 0.91 !! "));
        return version;
    }
View Full Code Here

    }

    private OMElement createEnvelope(String fileName) throws Exception {

        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",
                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

    call.invokeNonBlocking("echoString", getEchoOMBlock("echo3"),callback3);
  }


  private static OMElement getEchoOMBlock(String text) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace ns = fac.createOMNamespace("http://tempuri.org/","ns1");
    OMElement echoElement = fac.createOMElement("echoString", ns);
    OMElement param1Element = fac.createOMElement("Text", ns);
    OMElement param2Element = fac.createOMElement("Sequence", ns);
    echoElement.addChild(param1Element);
    echoElement.addChild(param2Element);
    param1Element.setText(text);
    param2Element.setText("sequenceid");
    return echoElement;
View Full Code Here

   
    call.close();
  }

  private static OMElement getEchoOMBlock(String text) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace defaultNS = fac.createOMNamespace("http://tempuri.apache.org","ns1");
    OMElement echoElement = fac.createOMElement("echoString", null);
    OMElement paramElement = fac.createOMElement("text", null);
    echoElement.addChild(paramElement);
    paramElement.setText(text);

    return echoElement;
  }
View Full Code Here

    clientOptions.setProperty(Sandesha2ClientAPI.LAST_MESSAGE, "true");
    sender.send("ping",getPingOMBlock("ping3"));
  }
 
  private static OMElement getPingOMBlock(String text) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace ns = fac.createOMNamespace("http://tempuri.apache.org",
        "ns1");
    OMElement pingElement = fac.createOMElement("ping", ns);
    OMElement paramElement = fac.createOMElement("param1", ns);
    pingElement.addChild(paramElement);
    paramElement.setText(text);

    return pingElement;
  }
View Full Code Here

    Callback callback3 = new TestCallback ("Callback 3");
    call.invokeNonBlocking("echoString", getEchoOMBlock("echo3"),callback3);
  }

  private static OMElement getEchoOMBlock(String text) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace defaultNS = fac.createOMNamespace("http://tempuri.apache.org","ns1");
    OMElement echoElement = fac.createOMElement("echoString", defaultNS);
    OMElement paramElement = fac.createOMElement("text", defaultNS);
    echoElement.addChild(paramElement);
    paramElement.setText(text);

    return echoElement;
  }
View Full Code Here

        responseText = tempText;
    }

    System.out.println("echoString got text:"
        + ((null == responseText) ? "" : responseText));
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://tempuri.org/",
        "echoString");
    OMElement method = fac.createOMElement("echoStringResponse", omNs);

    OMElement value = fac.createOMElement("text", omNs);

    if (responseText == null || "".equals(responseText))
      responseText = "echo response";

    value.setText(responseText);
View Full Code Here

TOP

Related Classes of org.apache.axis2.om.OMFactory

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.