org.apache.axiom.om.OMElement

Here are the examples of the java api class org.apache.axiom.om.OMElement taken from open source projects.

1. JsonFormatterTest#getResponseOMElement()

Project: axis2-java
File: JsonFormatterTest.java
private OMElement getResponseOMElement() {
    OMFactory omFactory = OMAbstractFactory.getOMFactory();
    OMNamespace ns = omFactory.createOMNamespace("", "");
    OMElement response = omFactory.createOMElement("response", ns);
    OMElement ret = omFactory.createOMElement("return", ns);
    OMElement name = omFactory.createOMElement("name", ns);
    name.setText("kate");
    OMElement age = omFactory.createOMElement("age", ns);
    age.setText("35");
    OMElement gender = omFactory.createOMElement("gender", ns);
    gender.setText("female");
    ret.addChild(name);
    ret.addChild(age);
    ret.addChild(gender);
    response.addChild(ret);
    return response;
}

2. GsonXMLStreamWriterTest#getResponseOMElement()

Project: axis2-java
File: GsonXMLStreamWriterTest.java
private OMElement getResponseOMElement() {
    OMFactory omFactory = OMAbstractFactory.getOMFactory();
    OMNamespace ns = omFactory.createOMNamespace("", "");
    OMElement response = omFactory.createOMElement("response", ns);
    OMElement ret = omFactory.createOMElement("return", ns);
    OMElement name = omFactory.createOMElement("name", ns);
    name.setText("kate");
    OMElement age = omFactory.createOMElement("age", ns);
    age.setText("35");
    OMElement gender = omFactory.createOMElement("gender", ns);
    gender.setText("female");
    ret.addChild(name);
    ret.addChild(age);
    ret.addChild(gender);
    response.addChild(ret);
    return response;
}

3. JAXWSServiceBuilderExtensionTest#testCheckPreconditionsServiceGroupWithMessageReceivers()

Project: axis2-java
File: JAXWSServiceBuilderExtensionTest.java
public void testCheckPreconditionsServiceGroupWithMessageReceivers() throws Exception {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMElement element = getOMElement(factory, "serviceGroup");
    element.addAttribute("name", "EchoService", null);
    OMElement mrs = getOMElement(factory, "messageReceivers");
    OMElement mr1 = getOMElement(factory, "messageReceiver");
    OMElement mr2 = getOMElement(factory, "messageReceiver");
    mr1.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mr2.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mrs.addChild(mr1);
    mrs.addChild(mr2);
    element.addChild(mrs);
    boolean result = builderExtension.checkPreconditions(element);
    assertEquals(false, result);
}

4. JAXWSServiceBuilderExtensionTest#testCheckPreconditionsServiceGroupWithWrongMessageReceivers()

Project: axis2-java
File: JAXWSServiceBuilderExtensionTest.java
public void testCheckPreconditionsServiceGroupWithWrongMessageReceivers() throws Exception {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMElement element = getOMElement(factory, "serviceGroup");
    element.addAttribute("name", "EchoService", null);
    OMElement mrs = getOMElement(factory, "messageReceivers");
    OMElement mr1 = getOMElement(factory, "messageReceiver");
    OMElement mr2 = getOMElement(factory, "messageReceiver");
    mr1.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mr2.addAttribute("class", "DummyCalss", null);
    mrs.addChild(mr1);
    mrs.addChild(mr2);
    element.addChild(mrs);
    boolean result = builderExtension.checkPreconditions(element);
    assertEquals(false, result);
}

5. JAXWSServiceBuilderExtensionTest#testCheckPreconditionsServiceWithMessageReceivers()

Project: axis2-java
File: JAXWSServiceBuilderExtensionTest.java
public void testCheckPreconditionsServiceWithMessageReceivers() throws Exception {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMElement element = getOMElement(factory, "service");
    element.addAttribute("name", "EchoService", null);
    OMElement mrs = getOMElement(factory, "messageReceivers");
    OMElement mr1 = getOMElement(factory, "messageReceiver");
    OMElement mr2 = getOMElement(factory, "messageReceiver");
    mr1.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mr2.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mrs.addChild(mr1);
    mrs.addChild(mr2);
    element.addChild(mrs);
    boolean result = builderExtension.checkPreconditions(element);
    assertEquals(true, result);
}

6. JAXWSServiceBuilderExtensionTest#testCheckPreconditionsServiceWithWrongMessageReceivers2()

Project: axis2-java
File: JAXWSServiceBuilderExtensionTest.java
public void testCheckPreconditionsServiceWithWrongMessageReceivers2() throws Exception {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMElement element = getOMElement(factory, "service");
    element.addAttribute("name", "EchoService", null);
    OMElement mrs = getOMElement(factory, "messageReceivers");
    OMElement mr1 = getOMElement(factory, "messageReceiver");
    OMElement mr2 = getOMElement(factory, "messageReceiver");
    mr1.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mr2.addAttribute("class", "DummyCalss", null);
    mrs.addChild(mr1);
    mrs.addChild(mr2);
    element.addChild(mrs);
    boolean result = builderExtension.checkPreconditions(element);
    assertEquals(false, result);
}

7. JAXWSServiceBuilderExtensionTest#testCheckPreconditionsServiceWithWrongMessageReceivers1()

Project: axis2-java
File: JAXWSServiceBuilderExtensionTest.java
public void testCheckPreconditionsServiceWithWrongMessageReceivers1() throws Exception {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMElement element = getOMElement(factory, "service");
    element.addAttribute("name", "EchoService", null);
    OMElement mrs = getOMElement(factory, "messageReceivers");
    OMElement mr1 = getOMElement(factory, "messageReceiver");
    OMElement mr2 = getOMElement(factory, "messageReceiver");
    mr1.addAttribute("class", "DummyCalss", null);
    mr2.addAttribute("class", "DummyCalss", null);
    mrs.addChild(mr1);
    mrs.addChild(mr2);
    element.addChild(mrs);
    boolean result = builderExtension.checkPreconditions(element);
    assertEquals(false, result);
}

8. JsonFormatterTest#createFaultOMElement()

Project: axis2-java
File: JsonFormatterTest.java
private OMElement createFaultOMElement() {
    OMFactory omFactory = OMAbstractFactory.getOMFactory();
    OMNamespace ns = omFactory.createOMNamespace("", "");
    OMElement faultCode = omFactory.createOMElement("faultcode", ns);
    faultCode.setText("soapenv:Server");
    OMElement faultString = omFactory.createOMElement("faultstring", ns);
    faultString.setText("javax.xml.stream.XMLStreamException");
    OMElement detail = omFactory.createOMElement("detail", ns);
    detail.setText("testFaultMsg");
    OMElement fault = omFactory.createOMElement("Fault", ns);
    fault.addChild(faultCode);
    fault.addChild(faultString);
    fault.addChild(detail);
    return fault;
}

9. TestWSDL20SupplierTemplate#customizeDocumentation()

Project: axis2-java
File: TestWSDL20SupplierTemplate.java
protected OMElement customizeDocumentation(OMElement documentation) {
    OMFactory fac = documentation.getOMFactory();
    OMElement details = fac.createOMElement("detail", "http://axis.apache.org", "ap");
    OMElement name = fac.createOMElement("name", "http://axis.apache.org", "ap");
    name.setText("Apache Axis2");
    OMElement mail = fac.createOMElement("email", "http://axis.apache.org", "ap");
    mail.setText("[email protected]");
    details.addChild(name);
    details.addChild(mail);
    documentation.addChild(details);
    OMElement doc = documentation.getFirstChildWithName(new QName("documentation"));
    doc.detach();
    return documentation;
}

10. TestWSDL11SupplierTemplate#customizeDocumentation()

Project: axis2-java
File: TestWSDL11SupplierTemplate.java
@Override
protected OMElement customizeDocumentation(OMElement documentation) {
    OMFactory fac = documentation.getOMFactory();
    OMElement details = fac.createOMElement("detail", "http://axis.apache.org", "ap");
    OMElement name = fac.createOMElement("name", "http://axis.apache.org", "ap");
    name.setText("Apache Axis2");
    OMElement mail = fac.createOMElement("email", "http://axis.apache.org", "ap");
    mail.setText("[email protected]");
    details.addChild(name);
    details.addChild(mail);
    documentation.addChild(details);
    OMElement doc = documentation.getFirstChildWithName(new QName("documentation"));
    doc.detach();
    return documentation;
}

11. AsyncEchoBlockingClient#getEchoOMBlock()

Project: sandesha
File: AsyncEchoBlockingClient.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    OMNamespace namespace = fac.createOMNamespace(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, "env");
    OMAttribute attr = fac.createOMAttribute("encodingStyle", namespace, "http://schemas.xmlsoap.org/soap/encoding/");
    echoStringElement.addAttribute(attr);
    return echoStringElement;
}

12. JSONSearchModel#getPayloadForYahooSearchCall()

Project: axis2-java
File: JSONSearchModel.java
private static OMElement getPayloadForYahooSearchCall(String queryStr, String formatStr) throws UnsupportedEncodingException {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMElement rootElement = fac.createOMElement("webSearch", null);
    OMElement appId = fac.createOMElement("appid", null, rootElement);
    appId.setText("ApacheRestDemo");
    OMElement query = fac.createOMElement("query", null, rootElement);
    query.setText(URLEncoder.encode(queryStr, "UTF-8"));
    OMElement outputType = fac.createOMElement("output", null, rootElement);
    outputType.setText("json");
    if (formatStr != null && formatStr.length() != 0) {
        OMElement format = fac.createOMElement("format", null, rootElement);
        format.setText(URLEncoder.encode(formatStr, "UTF-8"));
    }
    return rootElement;
}

13. AXIOMClient#updatePayload()

Project: axis2-java
File: AXIOMClient.java
public static OMElement updatePayload(String symbol, double price) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://quickstart.samples/xsd", "tns");
    OMElement method = fac.createOMElement("update", omNs);
    OMElement value1 = fac.createOMElement("symbol", omNs);
    value1.addChild(fac.createOMText(value1, symbol));
    method.addChild(value1);
    OMElement value2 = fac.createOMElement("price", omNs);
    value2.addChild(fac.createOMText(value2, Double.toString(price)));
    method.addChild(value2);
    return method;
}

14. WSDL20DynamicClient#creatMsg()

Project: axis2-java
File: WSDL20DynamicClient.java
public static OMElement creatMsg() {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://server.examples.axis2.apache.org", "ns1");
    // creating the payload
    OMElement method = fac.createOMElement("add", omNs);
    OMElement value1 = fac.createOMElement("value1", omNs);
    OMElement value2 = fac.createOMElement("value2", omNs);
    value1.setText("4");
    value2.setText("5");
    method.addChild(value1);
    method.addChild(value2);
    return method;
}

15. WSDL11DynamicClient#creatMsg()

Project: axis2-java
File: WSDL11DynamicClient.java
public static OMElement creatMsg() {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://server.examples.axis2.apache.org", "ns1");
    // creating the payload
    OMElement method = fac.createOMElement("add", omNs);
    OMElement value1 = fac.createOMElement("value1", omNs);
    OMElement value2 = fac.createOMElement("value2", omNs);
    value1.setText("4");
    value2.setText("3");
    method.addChild(value1);
    method.addChild(value2);
    return method;
}

16. MultipartFormDataFormatterTest#getEnvelope()

Project: axis2-java
File: MultipartFormDataFormatterTest.java
private SOAPEnvelope getEnvelope() throws IOException, MessagingException {
    SOAPFactory soapFac = OMAbstractFactory.getSOAP11Factory();
    OMFactory omFac = OMAbstractFactory.getOMFactory();
    SOAPEnvelope enp = soapFac.createSOAPEnvelope();
    SOAPBody sopaBody = soapFac.createSOAPBody();
    OMElement content = omFac.createOMElement(new QName("message"));
    OMElement data1 = omFac.createOMElement(new QName("part1"));
    data1.setText("sample data part 1");
    OMElement data2 = omFac.createOMElement(new QName("part2"));
    data2.setText("sample data part 2");
    content.addChild(data1);
    content.addChild(data2);
    sopaBody.addChild(content);
    enp.addChild(sopaBody);
    return enp;
}

17. RPCServiceClass#multireturn()

Project: axis2-java
File: RPCServiceClass.java
public OMElement multireturn(OMElement ele) throws XMLStreamException {
    SOAPFactory fac = OMAbstractFactory.getSOAP12Factory();
    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "res");
    OMElement method = fac.createOMElement("multiretuenResponse", omNs);
    OMElement value1 = fac.createOMElement("return0", null);
    value1.addChild(fac.createOMText(value1, "10"));
    method.addChild(value1);
    OMElement value2 = fac.createOMElement("return1", null);
    value2.addChild(fac.createOMText(value2, "foo"));
    method.addChild(value2);
    return method;
}

18. JSONIntegrationTest#createEnvelope()

Project: axis2-java
File: JSONIntegrationTest.java
protected OMElement createEnvelope() throws Exception {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("", "");
    OMElement rpcWrapEle = fac.createOMElement("echoOM", omNs);
    OMElement data = fac.createOMElement("data", omNs);
    OMElement data1 = fac.createOMElement("data", omNs);
    expectedString = "my json string";
    String expectedString1 = "my second json string";
    data.setText(expectedString);
    data1.setText(expectedString1);
    rpcWrapEle.addChild(data);
    rpcWrapEle.addChild(data1);
    return rpcWrapEle;
}

19. SandeshaTestCase#getEchoOMBlock()

Project: sandesha
File: SandeshaTestCase.java
protected static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

20. UserguideEchoClient#getEchoOMBlock()

Project: sandesha
File: UserguideEchoClient.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

21. SyncEchoClient#getEchoOMBlock()

Project: sandesha
File: SyncEchoClient.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

22. AsyncEchoWithPollingClient#getEchoOMBlock()

Project: sandesha
File: AsyncEchoWithPollingClient.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

23. AsyncEchoClient#getEchoOMBlock()

Project: sandesha
File: AsyncEchoClient.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

24. AnonEchoClient#getEchoOMBlock()

Project: sandesha
File: AnonEchoClient.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

25. SandeshaTestCase#getEchoOMBlock()

Project: sandesha
File: SandeshaTestCase.java
protected static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

26. Scenario_4_2#getEchoOMBlock()

Project: sandesha
File: Scenario_4_2.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

27. Scenario_3_1#getEchoOMBlock()

Project: sandesha
File: Scenario_3_1.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

28. Scenario_2_3#getEchoOMBlock()

Project: sandesha
File: Scenario_2_3.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

29. Scenario_2_2#getEchoOMBlock()

Project: sandesha
File: Scenario_2_2.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

30. Scenario_2_1#getEchoOMBlock()

Project: sandesha
File: Scenario_2_1.java
private static OMElement getEchoOMBlock(String text, String sequenceKey) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace applicationNamespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement echoStringElement = fac.createOMElement(echoString, applicationNamespace);
    OMElement textElem = fac.createOMElement(Text, applicationNamespace);
    OMElement sequenceElem = fac.createOMElement(Sequence, applicationNamespace);
    textElem.setText(text);
    sequenceElem.setText(sequenceKey);
    echoStringElement.addChild(textElem);
    echoStringElement.addChild(sequenceElem);
    return echoStringElement;
}

31. MTOMSerializationTests#createPayload()

Project: axis2-java
File: MTOMSerializationTests.java
private OMElement createPayload() {
    //Create a DataHandler with the String DataSource object
    DataHandler dataHandler = new DataHandler(imageDS);
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("urn://mtom.test.org", "mtom");
    OMElement sendImage = fac.createOMElement("sendImage", omNs);
    OMElement input = fac.createOMElement("input", omNs);
    sendImage.addChild(input);
    OMElement imageData = fac.createOMElement("imageData", omNs);
    input.addChild(imageData);
    OMText binaryData = fac.createOMText(dataHandler, true);
    imageData.addChild(binaryData);
    return sendImage;
}

32. WSDLSerializationUtil#generateSOAP12Binding()

Project: axis2-java
File: WSDLSerializationUtil.java
/**
     * Generates a default SOAP 12 Binding for a given AxisService
     * @param fac - The OMFactory
     * @param axisService - The AxisService
     * @param wsdl the WSDL namespace
     * @param wsoap - The WSDL 2.0 SOAP namespace
     * @param tns - The target namespace
     * @return - The generated SOAP12Binding element
     */
public static OMElement generateSOAP12Binding(OMFactory fac, AxisService axisService, OMNamespace wsdl, OMNamespace wsoap, OMNamespace tns, String serviceName) {
    OMElement binding = fac.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, wsdl);
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, serviceName + Java2WSDLConstants.SOAP12BINDING_NAME_SUFFIX));
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.INTERFACE_LOCAL_NAME, null, tns.getPrefix() + ":" + WSDL2Constants.DEFAULT_INTERFACE_NAME));
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_TYPE, null, WSDL2Constants.URI_WSDL2_SOAP));
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_VERSION, wsoap, WSDL2Constants.SOAP_VERSION_1_2));
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_PROTOCOL, wsoap, WSDL2Constants.HTTP_PROTOCAL));
    generateDefaultSOAPBindingOperations(axisService, fac, binding, wsdl, tns, wsoap);
    return binding;
}

33. WSDLSerializationUtil#generateSOAP11Binding()

Project: axis2-java
File: WSDLSerializationUtil.java
/**
     * Generates a default SOAP 11 Binding for a given AxisService
     * @param fac - The OMFactory
     * @param axisService - The AxisService
     * @param wsdl the WSDL namespace
     * @param wsoap - The WSDL 2.0 SOAP namespace
     * @param tns - The target namespace
     * @return - The generated SOAP11Binding element
     */
public static OMElement generateSOAP11Binding(OMFactory fac, AxisService axisService, OMNamespace wsdl, OMNamespace wsoap, OMNamespace tns, String serviceName) {
    OMElement binding = fac.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, wsdl);
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, serviceName + Java2WSDLConstants.BINDING_NAME_SUFFIX));
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.INTERFACE_LOCAL_NAME, null, tns.getPrefix() + ":" + WSDL2Constants.DEFAULT_INTERFACE_NAME));
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_TYPE, null, WSDL2Constants.URI_WSDL2_SOAP));
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_VERSION, wsoap, WSDL2Constants.SOAP_VERSION_1_1));
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_PROTOCOL, wsoap, WSDL2Constants.HTTP_PROTOCAL));
    generateDefaultSOAPBindingOperations(axisService, fac, binding, wsdl, tns, wsoap);
    return binding;
}

34. OMElementProvider#createPayload()

Project: axis2-java
File: OMElementProvider.java
private OMElement createPayload() {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://org/apache/axis2/jaxws/test/SOAPENVELOPE", "test");
    OMElement response = fac.createOMElement("echoOMElement", omNs);
    OMElement output = fac.createOMElement("output", omNs);
    response.addChild(output);
    OMElement data = fac.createOMElement("data", omNs);
    output.addChild(data);
    OMText binaryData = fac.createOMText("SAMPLE RESPONSE MESSAGE");
    data.addChild(binaryData);
    return response;
}

35. InstanceManagementTest#tearDown()

Project: ode
File: InstanceManagementTest.java
@AfterMethod
protected void tearDown() throws Exception {
    // Prepare undeploy message
    OMNamespace depns = _factory.createOMNamespace(Namespaces.ODE_DEPLOYAPI_NS, "deployapi");
    OMElement root = _factory.createOMElement("undeploy", depns);
    OMElement part = _factory.createOMElement("package", null);
    part.setText(_deployedName);
    root.addChild(part);
    // Undeploy
    sendToDeployment(root);
    OMElement listRoot = _client.buildMessage("listProcesses", new String[] { "filter", "orderKeys" }, new String[] { "name=DynPartnerMain", "" });
    OMElement result = sendToPM(listRoot);
    assertTrue("No process expected", result.toString().matches(".*<process-info-list\\s*/>.*"));
    super.tearDown();
}

36. DeploymentTest#undeploy()

Project: ode
File: DeploymentTest.java
private void undeploy(String pakage) throws Exception {
    // Prepare undeploy message
    OMNamespace depns = _factory.createOMNamespace(Namespaces.ODE_DEPLOYAPI_NS, "deployapi");
    OMElement root = _factory.createOMElement("undeploy", depns);
    OMElement part = _factory.createOMElement("packageName", null);
    part.setText(pakage);
    root.addChild(part);
    // Undeploy
    sendToDeployment(root);
    OMElement listRoot = _client.buildMessage("listProcesses", new String[] { "filter", "orderKeys" }, new String[] { "name=DynPartnerMain", "" });
    OMElement result = sendToPM(listRoot);
}

37. ProcessManagementTest#tearDown()

Project: ode
File: ProcessManagementTest.java
protected void tearDown() throws Exception {
    // Prepare undeploy message
    OMNamespace pmapi = _factory.createOMNamespace("http://www.apache.org/ode/pmapi", "pmapi");
    // qualified operation name
    OMElement root = _factory.createOMElement("undeploy", pmapi);
    OMElement part = _factory.createOMElement("processName", pmapi);
    part.setText("DynPartner");
    root.addChild(part);
    // Undeploy
    sendToDeployment(root);
    OMElement listRoot = _client.buildMessage("listProcesses", new String[] { "filter", "orderKeys" }, new String[] { "name=DynPartnerMain", "" });
    OMElement result = sendToPM(listRoot);
    assert (result.toString().indexOf("process-info") < 0);
}

38. ExecutionPathTest#tearDown()

Project: ode
File: ExecutionPathTest.java
protected void tearDown() throws Exception {
    // Prepare undeploy message
    OMNamespace depns = _factory.createOMNamespace(Namespaces.ODE_DEPLOYAPI_NS, "deployapi");
    OMElement root = _factory.createOMElement("undeploy", depns);
    OMElement part = _factory.createOMElement("packageName", null);
    part.setText("DynPartner");
    root.addChild(part);
    // Undeploy
    sendToDeployment(root);
    OMElement listRoot = _client.buildMessage("listProcesses", new String[] { "filter", "orderKeys" }, new String[] { "name=DynPartnerMain", "" });
    OMElement result = sendToPM(listRoot);
    assert (result.toString().indexOf("process-info") < 0);
}

39. TCPEchoRawXMLTest#testEchoXMLCompleteSync()

Project: axis2-transports
File: TCPEchoRawXMLTest.java
public void testEchoXMLCompleteSync() throws Exception {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
    OMElement payloadElement = fac.createOMElement("echoOMElement", omNs);
    OMElement value = fac.createOMElement("myValue", omNs);
    value.setText("Isaac Asimov, The Foundation Trilogy");
    payloadElement.addChild(value);
    Options options = new Options();
    options.setTo(targetEPR);
    options.setAction(Constants.AXIS2_NAMESPACE_URI + "/" + operationName.getLocalPart());
    options.setTransportInProtocol(Constants.TRANSPORT_TCP);
    options.setUseSeparateListener(true);
    ServiceClient sender = new ServiceClient(configContext, clientService);
    sender.setOptions(options);
    OMElement result = sender.sendReceive(operationName, payloadElement);
    result.serialize(StAXUtils.createXMLStreamWriter(System.out));
    sender.cleanup();
}

40. TCPEchoRawXMLTest#testEchoXMLCompleteSync()

Project: axis2-java
File: TCPEchoRawXMLTest.java
public void testEchoXMLCompleteSync() throws Exception {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
    OMElement payloadElement = fac.createOMElement("echoOMElement", omNs);
    OMElement value = fac.createOMElement("myValue", omNs);
    value.setText("Isaac Asimov, The Foundation Trilogy");
    payloadElement.addChild(value);
    Options options = new Options();
    options.setTo(targetEPR);
    options.setAction(Constants.AXIS2_NAMESPACE_URI + "/" + operationName.getLocalPart());
    options.setTransportInProtocol(Constants.TRANSPORT_TCP);
    options.setUseSeparateListener(true);
    ServiceClient sender = new ServiceClient(configContext, clientService);
    sender.setOptions(options);
    OMElement result = sender.sendReceive(operationName, payloadElement);
    result.serialize(StAXUtils.createXMLStreamWriter(System.out));
    sender.cleanup();
}

41. AxisService2WSDL11#generateEPRElement()

Project: axis2-java
File: AxisService2WSDL11.java
/*
	 * Generate the EndpointReference element
	 * <wsa:EndpointReference>
         *    <wsa:Address>
         *        http://some.service.epr/
         *     </wsa:Address>
         * </wsa:EndpointReference>
	 * 
	 */
private void generateEPRElement(AxisEndpoint endpoint, OMFactory fac, OMElement port, String endpointURL) {
    //an optional String parameter that contains x509 certificate information 
    Parameter x509CertIdentityParameter = axisService.getParameter(AddressingConstants.IDENTITY_PARAMETER);
    //an optional OMElement parameter that represents an <wsid:Identity> element
    OMElement identityElement = AddressingHelper.getAddressingIdentityParameterValue(endpoint);
    if ((x509CertIdentityParameter == null || x509CertIdentityParameter.getValue() == null) && identityElement == null) {
        //none of these is configured, for backward compatibility do not generate anything and return
        return;
    }
    OMElement wsaEpr = fac.createOMElement(AddressingConstants.Final.WSA_ENDPOINT_REFERENCE);
    OMElement address = fac.createOMElement(AddressingConstants.Final.WSA_ADDRESS);
    address.setText((endpointURL == null) ? "" : endpointURL);
    wsaEpr.addChild(address);
    // This will generate the identity element if the service parameter is set
    generateIdentityElement(fac, wsaEpr, identityElement, x509CertIdentityParameter);
    port.addChild(wsaEpr);
}

42. UnitTestSecurityManager#createSecurityTokenReference()

Project: sandesha
File: UnitTestSecurityManager.java
public OMElement createSecurityTokenReference(SecurityToken token, MessageContext message) {
    log.debug("Enter: UnitTestSecurityManager::createSecurityTokenReference");
    String uri = ((UnitTestSecurityToken) token).getURI();
    String type = ((UnitTestSecurityToken) token).getValueType();
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMNamespace secNS = factory.createOMNamespace(secNamespace, "wsse");
    OMElement str = factory.createOMElement("SecurityTokenReference", secNS);
    OMElement ref = factory.createOMElement("Reference", secNS);
    str.addChild(ref);
    OMAttribute uriAttr = factory.createOMAttribute("URI", null, uri);
    OMAttribute typeAttr = factory.createOMAttribute("ValueType", null, type);
    ref.addAttribute(uriAttr);
    ref.addAttribute(typeAttr);
    log.debug("Exit: UnitTestSecurityManager::createSecurityTokenReference " + str);
    return str;
}

43. TrustUtil#createLifetimeElement()

Project: rampart
File: TrustUtil.java
public static OMElement createLifetimeElement(int version, OMElement parent, String created, String expires) throws TrustException {
    String ns = getWSTNamespace(version);
    OMElement ltElem = createOMElement(parent, ns, RahasConstants.IssuanceBindingLocalNames.LIFETIME, RahasConstants.WST_PREFIX);
    OMElement createdElem = createOMElement(ltElem, WSConstants.WSU_NS, WSConstants.CREATED_LN, WSConstants.WSU_PREFIX);
    createdElem.setText(created);
    OMElement expiresElem = createOMElement(ltElem, WSConstants.WSU_NS, WSConstants.EXPIRES_LN, WSConstants.WSU_PREFIX);
    expiresElem.setText(expires);
    return ltElem;
}

44. TrustUtil#createRequestedUnattachedRef()

Project: rampart
File: TrustUtil.java
/**
     * Create and add wst:UnattachedReference element
     * 
     * @param rstrElem
     *            wst:RequestSecurityToken element
     * @param id
     *            Token identifier
     * @throws TrustException
     */
public static void createRequestedUnattachedRef(OMElement rstrElem, String id, int version) throws TrustException {
    OMFactory fac = null;
    OMElement rar = null;
    OMElement str = null;
    OMElement ki = null;
    String ns = TrustUtil.getWSTNamespace(version);
    fac = rstrElem.getOMFactory();
    rar = fac.createOMElement(new QName(ns, RahasConstants.IssuanceBindingLocalNames.REQUESTED_UNATTACHED_REFERENCE, RahasConstants.WST_PREFIX), rstrElem);
    str = fac.createOMElement(new QName(WSConstants.WSSE_NS, SecurityTokenReference.SECURITY_TOKEN_REFERENCE, WSConstants.WSSE_PREFIX), rar);
    ki = fac.createOMElement(new QName(WSConstants.WSSE_NS, "KeyIdentifier", WSConstants.WSSE_PREFIX), str);
    ki.addAttribute("ValueType", WSConstants.WSS_SAML_KI_VALUE_TYPE, null);
    ki.setText(id);
}

45. TrustUtil#createRequestedAttachedRef()

Project: rampart
File: TrustUtil.java
/**
     * Create and add wst:AttachedReference element
     * 
     * @param rstrElem
     *            wst:RequestSecurityToken element
     * @param id
     *            Token identifier
     * @throws TrustException
     */
public static void createRequestedAttachedRef(OMElement rstrElem, String id, int version) throws TrustException {
    OMFactory fac = null;
    OMElement rar = null;
    OMElement str = null;
    OMElement ki = null;
    String ns = TrustUtil.getWSTNamespace(version);
    fac = rstrElem.getOMFactory();
    rar = fac.createOMElement(new QName(ns, RahasConstants.IssuanceBindingLocalNames.REQUESTED_ATTACHED_REFERENCE, RahasConstants.WST_PREFIX), rstrElem);
    str = fac.createOMElement(new QName(WSConstants.WSSE_NS, SecurityTokenReference.SECURITY_TOKEN_REFERENCE, WSConstants.WSSE_PREFIX), rar);
    ki = fac.createOMElement(new QName(WSConstants.WSSE_NS, "KeyIdentifier", WSConstants.WSSE_PREFIX), str);
    ki.addAttribute("ValueType", WSConstants.WSS_SAML_KI_VALUE_TYPE, null);
    ki.setText(id);
}

46. RESTSearchModel#getPayloadForYahooSearchCall()

Project: axis2-java
File: RESTSearchModel.java
private static OMElement getPayloadForYahooSearchCall(String queryStr, String formatStr) throws UnsupportedEncodingException {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMElement rootElement = fac.createOMElement("webSearch", null);
    OMElement appId = fac.createOMElement("appid", null, rootElement);
    appId.setText("ApacheRestDemo");
    OMElement query = fac.createOMElement("query", null, rootElement);
    query.setText(URLEncoder.encode(queryStr, "UTF-8"));
    if (formatStr != null && formatStr.length() != 0) {
        OMElement format = fac.createOMElement("format", null, rootElement);
        format.setText(URLEncoder.encode(formatStr, "UTF-8"));
    }
    return rootElement;
}

47. StockQuoteService#getPrice()

Project: axis2-java
File: StockQuoteService.java
public OMElement getPrice(OMElement element) throws XMLStreamException {
    element.build();
    element.detach();
    OMElement symbolElement = element.getFirstElement();
    String symbol = symbolElement.getText();
    String returnText = "42";
    Double price = (Double) map.get(symbol);
    if (price != null) {
        returnText = "" + price.doubleValue();
    }
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace(namespace, "ns");
    OMElement method = fac.createOMElement("getPriceResponse", omNs);
    OMElement value = fac.createOMElement("return", omNs);
    value.addChild(fac.createOMText(value, returnText));
    method.addChild(value);
    return method;
}

48. PingService#getPrice()

Project: axis2-java
File: PingService.java
public OMElement getPrice(OMElement element) throws XMLStreamException {
    element.build();
    element.detach();
    OMElement symbolElement = element.getFirstElement();
    String symbol = symbolElement.getText();
    String returnText = "42";
    Double price = (Double) map.get(symbol);
    if (price != null) {
        returnText = "" + price.doubleValue();
    }
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://quickstart.samples/xsd", "ns");
    OMElement method = fac.createOMElement("getPriceResponse", omNs);
    OMElement value = fac.createOMElement("return", omNs);
    value.addChild(fac.createOMText(value, returnText));
    method.addChild(value);
    return method;
}

49. FixedValueTest#testFixedStringElementParse2()

Project: axis2-java
File: FixedValueTest.java
public void testFixedStringElementParse2() throws Exception {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMElement element = factory.createOMElement(new QName("", "fixedStringElement"));
    OMElement msg = factory.createOMElement(new QName("", "msg"));
    msg.setText("");
    element.addChild(msg);
    FixedStringElement fixedStringElement = FixedStringElement.Factory.parse(element.getXMLStreamReader());
    assertNotNull(fixedStringElement.getFixedStringElement().getMsg());
    assertEquals("ABC", fixedStringElement.getFixedStringElement().getMsg());
    assertFalse("".equalsIgnoreCase(fixedStringElement.getFixedStringElement().getMsg()));
}

50. FixedValueTest#testFixedStringElementParse1()

Project: axis2-java
File: FixedValueTest.java
public void testFixedStringElementParse1() throws Exception {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMElement element = factory.createOMElement(new QName("", "fixedStringElement"));
    OMElement msg = factory.createOMElement(new QName("", "msg"));
    msg.setText("xyz");
    element.addChild(msg);
    FixedStringElement fixedStringElement = FixedStringElement.Factory.parse(element.getXMLStreamReader());
    assertNotNull(fixedStringElement.getFixedStringElement().getMsg());
    assertEquals("ABC", fixedStringElement.getFixedStringElement().getMsg());
    assertFalse("xyz".equalsIgnoreCase(fixedStringElement.getFixedStringElement().getMsg()));
}

51. DefaultValueTest#testDefaultStringElementParse2()

Project: axis2-java
File: DefaultValueTest.java
public void testDefaultStringElementParse2() throws Exception {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMElement element = factory.createOMElement(new QName("", "defaultStringElement"));
    OMElement msg = factory.createOMElement(new QName("", "msg"));
    msg.setText("xyz");
    element.addChild(msg);
    DefaultStringElement defaultStringElement = DefaultStringElement.Factory.parse(element.getXMLStreamReader());
    System.out.println(defaultStringElement.getDefaultStringElement().getMsg());
    assertNotNull(defaultStringElement.getDefaultStringElement().getMsg());
    assertEquals("xyz", defaultStringElement.getDefaultStringElement().getMsg());
}

52. MTOMPingClient#getPingOMBlock()

Project: sandesha
File: MTOMPingClient.java
private static OMElement getPingOMBlock() throws AxisFault {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace namespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement pingElem = fac.createOMElement(MTOMPing, namespace);
    OMElement attachmentElem = fac.createOMElement("Attachment", namespace);
    String imageName = "test-resources" + File.separator + "mtom-image.jpg";
    FileDataSource dataSource;
    try {
        dataSource = new FileDataSource(new File(imageName));
    } catch (Exception e) {
        throw AxisFault.makeFault(e);
    }
    DataHandler dataHandler = new DataHandler(dataSource);
    OMText textData = fac.createOMText(dataHandler, true);
    attachmentElem.addChild(textData);
    pingElem.addChild(attachmentElem);
    return pingElem;
}

53. Scenario_2_3#populateToEPRToRejectOffers()

Project: sandesha
File: Scenario_2_3.java
private void populateToEPRToRejectOffers(EndpointReference toEPR) {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMNamespace namespace = factory.createOMNamespace("urn:wsrm:InteropOptions", "rmi");
    OMElement acceptOfferElem = factory.createOMElement("acceptOffer", namespace);
    OMElement useOfferElem = factory.createOMElement("useOffer", namespace);
    acceptOfferElem.setText("false");
    useOfferElem.setText("false");
    toEPR.addReferenceParameter(acceptOfferElem);
    toEPR.addReferenceParameter(useOfferElem);
}

54. Scenario_1_4#getPingOMBlock()

Project: sandesha
File: Scenario_1_4.java
private static OMElement getPingOMBlock(String text) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace namespace = fac.createOMNamespace(applicationNamespaceName, "ns1");
    OMElement pingElem = fac.createOMElement(ping, namespace);
    OMElement textElem = fac.createOMElement(Text, namespace);
    textElem.setText(text);
    pingElem.addChild(textElem);
    return pingElem;
}

55. TrustUtil#createAppliesToElement()

Project: rampart
File: TrustUtil.java
public static OMElement createAppliesToElement(OMElement parent, String address, String addressingNs) {
    OMElement appliesToElem = createOMElement(parent, RahasConstants.WSP_NS, RahasConstants.IssuanceBindingLocalNames.APPLIES_TO, RahasConstants.WSP_PREFIX);
    OMElement eprElem = createOMElement(appliesToElem, addressingNs, "EndpointReference", AddressingConstants.WSA_DEFAULT_PREFIX);
    OMElement addressElem = createOMElement(eprElem, addressingNs, AddressingConstants.EPR_ADDRESS, AddressingConstants.WSA_DEFAULT_PREFIX);
    addressElem.setText(address);
    return appliesToElem;
}

56. AddressingIdentityServiceTest#checkWsdlContainsIdentityElement()

Project: axis2-java
File: AddressingIdentityServiceTest.java
private OMElement checkWsdlContainsIdentityElement(OMElement wsdl, AxisService service, AxisEndpoint endpoint) {
    QName nameAtt = new QName("", Java2WSDLConstants.ATTRIBUTE_NAME);
    QName serviceQName = new QName(WSDLConstants.WSDL1_1_NAMESPACE, Java2WSDLConstants.SERVICE_LOCAL_NAME);
    OMElement serviceElement = wsdl.getFirstChildWithName(serviceQName);
    assertNotNull(String.format("Could not find any '%s' service element in wsdl: \n%s", serviceQName, wsdl.toString()), serviceElement);
    assertEquals("Expected to find a single service with name: " + service.getName(), service.getName(), serviceElement.getAttributeValue(nameAtt));
    OMElement portElement = findPort(serviceElement, endpoint.getName());
    assertNotNull(String.format("Could not find any port element with name '%s' in service element: \n%s", endpoint.getName(), serviceElement.toString()), portElement);
    OMElement eprElement = portElement.getFirstChildWithName(AddressingConstants.Final.WSA_ENDPOINT_REFERENCE);
    assertNotNull(String.format("Could not find any '%s' element in port element: \n%s", AddressingConstants.Final.WSA_ENDPOINT_REFERENCE, portElement.toString()), eprElement);
    OMElement identityElement = eprElement.getFirstChildWithName(AddressingConstants.QNAME_IDENTITY);
    assertNotNull(String.format("Could not find any '%s' element in EPR element: \n%s", AddressingConstants.QNAME_IDENTITY, eprElement.toString(), identityElement));
    return identityElement;
}

57. WSDLSerializationUtil#generateHTTPBinding()

Project: axis2-java
File: WSDLSerializationUtil.java
/**
     * Generates a default HTTP Binding for a given AxisService
     * @param fac - The OMFactory
     * @param axisService - The AxisService
     * @param wsdl the WSDL namespace
     * @param whttp - The WSDL 2.0 HTTP namespace
     * @param tns - The target namespace
     * @return - The generated HTTPBinding element
     */
public static OMElement generateHTTPBinding(OMFactory fac, AxisService axisService, OMNamespace wsdl, OMNamespace whttp, OMNamespace tns, String serviceName) {
    OMElement binding = fac.createOMElement(WSDL2Constants.BINDING_LOCAL_NAME, wsdl);
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, serviceName + Java2WSDLConstants.HTTP_BINDING));
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.INTERFACE_LOCAL_NAME, null, tns.getPrefix() + ":" + WSDL2Constants.DEFAULT_INTERFACE_NAME));
    binding.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_TYPE, null, WSDL2Constants.URI_WSDL2_HTTP));
    Iterator iterator = axisService.getChildren();
    while (iterator.hasNext()) {
        AxisOperation axisOperation = (AxisOperation) iterator.next();
        OMElement opElement = fac.createOMElement(WSDL2Constants.OPERATION_LOCAL_NAME, wsdl);
        binding.addChild(opElement);
        String name = axisOperation.getName().getLocalPart();
        opElement.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_REF, null, tns.getPrefix() + ":" + name));
        opElement.addAttribute(fac.createOMAttribute(WSDL2Constants.ATTRIBUTE_LOCATION, whttp, name));
    }
    return binding;
}

58. JAXWSServiceBuilderExtensionTest#testCheckPreconditionsServiceGroupWithMessageReceivers3()

Project: axis2-java
File: JAXWSServiceBuilderExtensionTest.java
public void testCheckPreconditionsServiceGroupWithMessageReceivers3() throws Exception {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMElement group = getOMElement(factory, "serviceGroup");
    OMElement element1 = getOMElement(factory, "service");
    element1.addAttribute("name", "EchoService", null);
    OMElement mrs = getOMElement(factory, "messageReceivers");
    OMElement mr1 = getOMElement(factory, "messageReceiver");
    OMElement mr2 = getOMElement(factory, "messageReceiver");
    mr1.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mr2.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mrs.addChild(mr1);
    mrs.addChild(mr2);
    element1.addChild(mrs);
    group.addChild(element1);
    OMElement element2 = getOMElement(factory, "service");
    element2.addAttribute("name", "EchoService2", null);
    OMElement mrs2 = getOMElement(factory, "messageReceivers");
    OMElement mr12 = getOMElement(factory, "messageReceiver");
    OMElement mr22 = getOMElement(factory, "messageReceiver");
    mr12.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mr22.addAttribute("class", "Dummy", null);
    mrs2.addChild(mr12);
    mrs2.addChild(mr22);
    element2.addChild(mrs2);
    group.addChild(element1);
    group.addChild(element2);
    boolean result = builderExtension.checkPreconditions(group);
    assertEquals(false, result);
}

59. JAXWSServiceBuilderExtensionTest#testCheckPreconditionsServiceGroupWithMessageReceivers2()

Project: axis2-java
File: JAXWSServiceBuilderExtensionTest.java
public void testCheckPreconditionsServiceGroupWithMessageReceivers2() throws Exception {
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMElement group = getOMElement(factory, "serviceGroup");
    OMElement element1 = getOMElement(factory, "service");
    element1.addAttribute("name", "EchoService", null);
    OMElement mrs = getOMElement(factory, "messageReceivers");
    OMElement mr1 = getOMElement(factory, "messageReceiver");
    OMElement mr2 = getOMElement(factory, "messageReceiver");
    mr1.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mr2.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mrs.addChild(mr1);
    mrs.addChild(mr2);
    element1.addChild(mrs);
    group.addChild(element1);
    OMElement element2 = getOMElement(factory, "service");
    element2.addAttribute("name", "EchoService2", null);
    OMElement mrs2 = getOMElement(factory, "messageReceivers");
    OMElement mr12 = getOMElement(factory, "messageReceiver");
    OMElement mr22 = getOMElement(factory, "messageReceiver");
    mr12.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mr22.addAttribute("class", "org.apache.axis2.jaxws.server.JAXWSMessageReceiver", null);
    mrs2.addChild(mr12);
    mrs2.addChild(mr22);
    element2.addChild(mrs2);
    group.addChild(element1);
    group.addChild(element2);
    boolean result = builderExtension.checkPreconditions(group);
    assertEquals(true, result);
}

60. EchoRawSwATest#createEnvelope()

Project: axis2-java
File: EchoRawSwATest.java
protected SOAPEnvelope createEnvelope() throws Exception {
    SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
    SOAPEnvelope env = fac.getDefaultEnvelope();
    OMNamespace omNs = fac.createOMNamespace("htp://localhost/my", "my");
    OMElement rpcWrapEle = fac.createOMElement("echoOMElement", omNs);
    OMElement data = fac.createOMElement("data", omNs);
    OMText textData = fac.createOMText("Apache Axis2 Rocks !!!");
    data.addChild(textData);
    rpcWrapEle.addChild(data);
    env.getBody().addChild(rpcWrapEle);
    return env;
}

61. MessageSaveAndRestoreWithMTOMTest#createEnvelope()

Project: axis2-java
File: MessageSaveAndRestoreWithMTOMTest.java
protected OMElement createEnvelope() throws Exception {
    OMFactory omFactory = OMAbstractFactory.getOMFactory();
    OMNamespace omNamespace = omFactory.createOMNamespace("http://localhost/my", "my");
    OMElement rpcWrapperElement = omFactory.createOMElement("echoOMElement", omNamespace);
    OMElement data = omFactory.createOMElement("data", omNamespace);
    FileDataSource fileDataSource = new FileDataSource(TestingUtils.prefixBaseDirectory("test-resources/mtom/test.jpg"));
    DataHandler expectedDataHandler = new DataHandler(fileDataSource);
    expectedTextData = omFactory.createOMText(expectedDataHandler, true);
    data.addChild(expectedTextData);
    rpcWrapperElement.addChild(data);
    return rpcWrapperElement;
}

62. EchoRawMTOMToBase64Test#createPayload()

Project: axis2-java
File: EchoRawMTOMToBase64Test.java
private OMElement createPayload() {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
    OMElement rpcWrapEle = fac.createOMElement("echoMTOMtoBase64", omNs);
    OMElement data = fac.createOMElement("data", omNs);
    byte[] byteArray = new byte[] { 13, 56, 65, 32, 12, 12, 7, 98 };
    DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
    expectedTextData = fac.createOMText(dataHandler, true);
    data.addChild(expectedTextData);
    rpcWrapEle.addChild(data);
    return rpcWrapEle;
}

63. EchoRawMTOMTest#createEnvelope()

Project: axis2-java
File: EchoRawMTOMTest.java
protected OMElement createEnvelope() throws Exception {
    DataHandler expectedDH;
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
    OMElement rpcWrapEle = fac.createOMElement("echoOMElement", omNs);
    OMElement data = fac.createOMElement("data", omNs);
    FileDataSource fileDataSource = new FileDataSource(TestingUtils.prefixBaseDirectory("test-resources/mtom/test.jpg"));
    expectedDH = new DataHandler(fileDataSource);
    expectedTextData = fac.createOMText(expectedDH, true);
    data.addChild(expectedTextData);
    rpcWrapEle.addChild(data);
    return rpcWrapEle;
}

64. EchoRawMTOMStreamingTest#createEnvelope()

Project: axis2-java
File: EchoRawMTOMStreamingTest.java
private OMElement createEnvelope() throws Exception {
    DataHandler expectedDH;
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
    OMElement rpcWrapEle = fac.createOMElement("mtomSample", omNs);
    data = fac.createOMElement("data", omNs);
    expectedDH = new DataHandler(new ByteArrayDataSource(new byte[] { 13, 56, 65, 32, 12, 12, 7, -3, -2, -1, 98 }));
    OMElement subData = fac.createOMElement("subData", omNs);
    OMText textData = fac.createOMText(expectedDH, true);
    subData.addChild(textData);
    data.addChild(subData);
    rpcWrapEle.addChild(data);
    return rpcWrapEle;
}

65. EchoRawMTOMCommonsChunkingTest#createEnvelope()

Project: axis2-java
File: EchoRawMTOMCommonsChunkingTest.java
private OMElement createEnvelope() throws Exception {
    DataHandler expectedDH;
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
    OMElement rpcWrapEle = fac.createOMElement("echoOMElement", omNs);
    data = fac.createOMElement("data", omNs);
    FileDataSource dataSource = new FileDataSource(fileName);
    expectedDH = new DataHandler(dataSource);
    OMElement subData = fac.createOMElement("subData", omNs);
    OMText textData = fac.createOMText(expectedDH, true);
    subData.addChild(textData);
    data.addChild(subData);
    rpcWrapEle.addChild(data);
    return rpcWrapEle;
}

66. InstanceManagementTest#testDeleteInstances()

Project: ode
File: InstanceManagementTest.java
@Test
public void testDeleteInstances() throws Exception {
    OMElement root = _client.buildMessage("listAllInstancesWithLimit", new String[] { "limit" }, new String[] { "1" });
    OMElement result = sendToIM(root);
    String iid = instances(result).get(0).getFirstElement().getText();
    System.out.println("=> " + iid);
    OMElement msg = _client.buildMessage("delete", new String[] { "filter" }, new String[] { "iid=" + iid });
    OMElement response = sendToIM(msg);
    System.out.println(response);
    List<OMElement> elements = IteratorUtils.toList(response.getFirstElement().getChildrenWithName(new QName("", "element")));
    assertTrue("Must delete only one instance", elements.size() == 1);
    assertTrue(iid.equals(elements.get(0).getText()));
}

67. DeploymentTest#testGetProcessPackage()

Project: ode
File: DeploymentTest.java
@Test
public void testGetProcessPackage() throws Exception {
    OMElement root = _client.buildMessage("getProcessPackage", new String[] { "processId" }, new Object[] { _deployed.get(0) });
    OMElement result = sendToDeployment(root);
    assertEquals(_package, result.getFirstElement().getText());
    OMElement root2 = _client.buildMessage("getProcessPackage", new String[] { "processId" }, new Object[] { _deployed.get(1) });
    OMElement result2 = sendToDeployment(root2);
    assertEquals(_package, result2.getFirstElement().getText());
}

68. ProcessManagementTest#testSetProcessPropertyNode()

Project: ode
File: ProcessManagementTest.java
public void testSetProcessPropertyNode() throws Exception {
    OMElement propElmt = _factory.createOMElement("testprop", null);
    propElmt.setText("propvalue");
    OMElement root = _client.buildMessage("setProcessPropertyNode", new String[] { "pid", "propertyName", "propertyValue" }, new Object[] { new QName("http://ode/bpel/unit-test", "DynPartnerMain"), new QName("http://ode/custom/ns", "someprop"), propElmt });
    OMElement result = sendToPM(root);
    assertTrue(result.toString().indexOf("DynPartnerMain") >= 0);
    assertTrue(result.toString().indexOf("testprop") >= 0);
    assertTrue(result.toString().indexOf("propvalue") >= 0);
}

69. JMSTransportDescriptionFactory#setupConnectionFactoryConfig()

Project: axis2-transports
File: JMSTransportDescriptionFactory.java
private void setupConnectionFactoryConfig(ParameterInclude trpDesc, String name, String connFactName, String type) throws AxisFault {
    OMElement element = createParameterElement(JMSConstants.DEFAULT_CONFAC_NAME, null);
    element.addChild(createParameterElement(Context.INITIAL_CONTEXT_FACTORY, MockContextFactory.class.getName()));
    element.addChild(createParameterElement(JMSConstants.PARAM_CONFAC_JNDI_NAME, connFactName));
    if (type != null) {
        element.addChild(createParameterElement(JMSConstants.PARAM_CONFAC_TYPE, type));
    }
    element.addChild(createParameterElement(JMSConstants.PARAM_CONCURRENT_CONSUMERS, Integer.toString(concurrentConsumers)));
    trpDesc.addParameter(new Parameter(name, element));
}

70. JMSTransportDescriptionFactory#setupConnectionFactoryConfig()

Project: axis2-java
File: JMSTransportDescriptionFactory.java
private void setupConnectionFactoryConfig(ParameterInclude trpDesc, String name, String connFactName, String type) throws AxisFault {
    OMElement element = createParameterElement(JMSConstants.DEFAULT_CONFAC_NAME, null);
    element.addChild(createParameterElement(Context.INITIAL_CONTEXT_FACTORY, MockContextFactory.class.getName()));
    element.addChild(createParameterElement(JMSConstants.PARAM_CONFAC_JNDI_NAME, connFactName));
    if (type != null) {
        element.addChild(createParameterElement(JMSConstants.PARAM_CONFAC_TYPE, type));
    }
    element.addChild(createParameterElement(JMSConstants.PARAM_CONCURRENT_CONSUMERS, Integer.toString(concurrentConsumers)));
    Parameter parameter = new Parameter();
    parameter.setName(name);
    parameter.setParameterElement(element);
    trpDesc.addParameter(parameter);
}

71. AbstractHTTPServerTest#getEnvelope()

Project: axis2-java
File: AbstractHTTPServerTest.java
/**
     * Gets the envelope with sample data.
     * 
     * @return the envelope
     * @throws IOException
     *             Signals that an I/O exception has occurred.
     */
public static SOAPEnvelope getEnvelope() throws IOException {
    SOAPFactory soapFac = OMAbstractFactory.getSOAP11Factory();
    OMFactory omFac = OMAbstractFactory.getOMFactory();
    SOAPEnvelope enp = soapFac.createSOAPEnvelope();
    SOAPBody sopaBody = soapFac.createSOAPBody();
    OMElement content = omFac.createOMElement(new QName("message"));
    OMElement data1 = omFac.createOMElement(new QName("part"));
    data1.setText("sample data");
    content.addChild(data1);
    sopaBody.addChild(content);
    enp.addChild(sopaBody);
    return enp;
}

72. CommonsHTTPTransportSenderTest#getEnvelope()

Project: axis2-java
File: CommonsHTTPTransportSenderTest.java
static SOAPEnvelope getEnvelope() throws IOException {
    SOAPFactory soapFac = OMAbstractFactory.getSOAP11Factory();
    OMFactory omFac = OMAbstractFactory.getOMFactory();
    SOAPEnvelope enp = soapFac.createSOAPEnvelope();
    SOAPBody sopaBody = soapFac.createSOAPBody();
    OMElement content = omFac.createOMElement(new QName("message"));
    OMElement data1 = omFac.createOMElement(new QName("part"));
    data1.setText("sample data");
    content.addChild(data1);
    sopaBody.addChild(content);
    enp.addChild(sopaBody);
    return enp;
}

73. XMLSpineImpl#setBodyBlock()

Project: axis2-java
File: XMLSpineImpl.java
public void setBodyBlock(int index, Block block) throws WebServiceException {
    // Forces the parser to read all of the blocks
    getNumBodyBlocks();
    block.setParent(getParent());
    OMElement bElement = _getBodyBlockParent();
    OMElement om = this._getChildOMElement(bElement, index);
    // The block is supposed to represent a single element.  
    // But if it does not represent an element , the following will fail.
    QName qName = block.getQName();
    OMNamespace ns = soapFactory.createOMNamespace(qName.getNamespaceURI(), qName.getPrefix());
    OMElement newOM = _createOMElementFromBlock(qName.getLocalPart(), ns, block, soapFactory, false);
    if (om == null) {
        bElement.addChild(newOM);
    } else {
        om.insertSiblingBefore(newOM);
        om.detach();
    }
}

74. EchoRawMTOMTest#testEchoXMLSyncSeperateListener()

Project: axis2-java
File: EchoRawMTOMTest.java
public void testEchoXMLSyncSeperateListener() throws Exception {
    OMElement payload = createEnvelope();
    Options options = new Options();
    options.setTo(targetEPR);
    options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);
    ServiceClient sender = new ServiceClient(configContext, null);
    sender.engageModule("addressing");
    options.setAction(Constants.AXIS2_NAMESPACE_URI + "/" + operationName.getLocalPart());
    sender.setOptions(options);
    options.setUseSeparateListener(true);
    options.setTo(targetEPR);
    OMElement result = sender.sendReceive(payload);
    OMElement ele = (OMElement) result.getFirstOMChild();
    OMText binaryNode = (OMText) ele.getFirstOMChild();
    // to the assert equal
    compareWithCreatedOMText(binaryNode);
}

75. EchoRawMTOMLoadTest#createEnvelope()

Project: axis2-java
File: EchoRawMTOMLoadTest.java
protected OMElement createEnvelope() {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
    OMElement rpcWrapEle = fac.createOMElement("echoOMElement", omNs);
    OMElement data = fac.createOMElement("data", omNs);
    expectedByteArray = new byte[] { 13, 56, 65, 32, 12, 12, 7, -3, -2, -1, 98 };
    for (int i = 0; i < 4; i++) {
        OMElement subData = fac.createOMElement("subData", omNs);
        DataHandler dataHandler = new DataHandler("Thilina", "text/plain");
        //new ByteArrayDataSource(expectedByteArray));
        textData = fac.createOMText(dataHandler, true);
        subData.addChild(textData);
        data.addChild(subData);
    }
    rpcWrapEle.addChild(data);
    return rpcWrapEle;
}

76. EchoRawMTOMCommonsChunkingTest#testEchoXMLSync()

Project: axis2-java
File: EchoRawMTOMCommonsChunkingTest.java
public void testEchoXMLSync() throws Exception {
    OMElement payload = createEnvelope();
    Options options = new Options();
    options.setTo(targetEPR);
    options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(TestingUtils.prefixBaseDirectory(Constants.TESTING_PATH + "commons-http-enabledRepository"), null);
    ServiceClient sender = new ServiceClient(configContext, null);
    sender.setOptions(options);
    options.setTo(targetEPR);
    OMElement ret = sender.sendReceive(payload);
    ret.build();
    this.compareWithCreatedOMElement(ret);
}

77. PojoTest#testDeleteDataFromURLandBody()

Project: axis2-java
File: PojoTest.java
public void testDeleteDataFromURLandBody() throws Exception {
    Options options = TestUtil.getPojoTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/getFromBody/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_DELETE);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getPojoTestServiceClient(options);
    String stringPayload = "<addDataFromURLandBody xmlns=\"http://ws.apache.org/axis2\"><data1>account</data1><data2>password</data2></addDataFromURLandBody>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("return"));
    assertEquals("account and password deleted", returnElem.getText());
}

78. PojoTest#testDeleteDataFromURL()

Project: axis2-java
File: PojoTest.java
public void testDeleteDataFromURL() throws Exception {
    Options options = TestUtil.getPojoTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/delete/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_DELETE);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getPojoTestServiceClient(options);
    String stringPayload = "<deleteDataFromURL xmlns=\"http://ws.apache.org/axis2\"><data1>account</data1></deleteDataFromURL>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("return"));
    assertEquals("account deleted", returnElem.getText());
}

79. PojoTest#testGetDataFromURLandBody()

Project: axis2-java
File: PojoTest.java
public void testGetDataFromURLandBody() throws Exception {
    Options options = TestUtil.getPojoTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/getFromBody/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_GET);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getPojoTestServiceClient(options);
    String stringPayload = "<addDataFromURLandBody xmlns=\"http://ws.apache.org/axis2\"><data1>account</data1><data2>password</data2></addDataFromURLandBody>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("return"));
    assertEquals("account and password read", returnElem.getText());
}

80. PojoTest#testGetDataFromURL()

Project: axis2-java
File: PojoTest.java
public void testGetDataFromURL() throws Exception {
    Options options = TestUtil.getPojoTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/get/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_GET);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getPojoTestServiceClient(options);
    String stringPayload = "<getDataFromURL xmlns=\"http://ws.apache.org/axis2\"><data1>account</data1></getDataFromURL>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("return"));
    assertEquals("account read", returnElem.getText());
}

81. PojoTest#testUpdateDataFromURLandBody()

Project: axis2-java
File: PojoTest.java
public void testUpdateDataFromURLandBody() throws Exception {
    Options options = TestUtil.getPojoTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/getFromBody/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_PUT);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getPojoTestServiceClient(options);
    String stringPayload = "<addDataFromURLandBody xmlns=\"http://ws.apache.org/axis2\"><data1>account</data1><data2>password</data2></addDataFromURLandBody>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("return"));
    assertEquals("account and password updated", returnElem.getText());
}

82. PojoTest#testUpdateDataFromURL()

Project: axis2-java
File: PojoTest.java
public void testUpdateDataFromURL() throws Exception {
    Options options = TestUtil.getPojoTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/update/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_PUT);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getPojoTestServiceClient(options);
    String stringPayload = "<addDataFromURL xmlns=\"http://ws.apache.org/axis2\"><data1>account</data1></addDataFromURL>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("return"));
    assertEquals("account updated", returnElem.getText());
}

83. PojoTest#testAddDataFromURLandBody()

Project: axis2-java
File: PojoTest.java
public void testAddDataFromURLandBody() throws Exception {
    Options options = TestUtil.getPojoTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/getFromBody/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_POST);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getPojoTestServiceClient(options);
    String stringPayload = "<addDataFromURLandBody xmlns=\"http://ws.apache.org/axis2\"><data1>account</data1><data2>password</data2></addDataFromURLandBody>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("return"));
    assertEquals("account and password created", returnElem.getText());
}

84. PojoTest#testAddDataFromURL()

Project: axis2-java
File: PojoTest.java
public void testAddDataFromURL() throws Exception {
    Options options = TestUtil.getPojoTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/add/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_POST);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getPojoTestServiceClient(options);
    String stringPayload = "<addDataFromURL xmlns=\"http://ws.apache.org/axis2\"><data1>account</data1></addDataFromURL>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("return"));
    assertEquals("account created", returnElem.getText());
}

85. ArchiveDeploymentTest#testCheckTypepublishing()

Project: axis2-java
File: ArchiveDeploymentTest.java
public void testCheckTypepublishing() throws Exception {
    Options options = TestUtil.getArchiveTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_POST);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getArchiveTestServiceClient(options);
    String stringPayload = "<checkTypePublishing xmlns=\"http://jaxrs.apache.org\">null</checkTypePublishing>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("http://jaxrs.apache.org", "return"));
    assertEquals("true", returnElem.getText());
}

86. ArchiveDeploymentTest#testCheckServicesXMLoverriding()

Project: axis2-java
File: ArchiveDeploymentTest.java
public void testCheckServicesXMLoverriding() throws Exception {
    Options options = TestUtil.getArchiveTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "serviceroot/check");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_POST);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_APPLICATION_XML);
    ServiceClient sender = TestUtil.getArchiveTestServiceClient(options);
    String stringPayload = "<checkServicesXMLoverriding xmlns=\"http://jaxrs.apache.org\"><data1>account</data1><data2>password</data2></checkServicesXMLoverriding>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("http://jaxrs.apache.org", "return"));
    assertEquals("account and password correct", returnElem.getText());
}

87. ArchiveDeploymentTest#testDeleteDataFromURLandBody()

Project: axis2-java
File: ArchiveDeploymentTest.java
public void testDeleteDataFromURLandBody() throws Exception {
    Options options = TestUtil.getArchiveTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/getFromBody/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_DELETE);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getArchiveTestServiceClient(options);
    String stringPayload = "<addDataFromURLandBody xmlns=\"http://jaxrs.apache.org\"><data1>account</data1><data2>password</data2></addDataFromURLandBody>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("http://jaxrs.apache.org", "return"));
    assertEquals("account and password deleted", returnElem.getText());
}

88. ArchiveDeploymentTest#testDeleteDataFromURL()

Project: axis2-java
File: ArchiveDeploymentTest.java
public void testDeleteDataFromURL() throws Exception {
    Options options = TestUtil.getArchiveTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/delete/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_DELETE);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getArchiveTestServiceClient(options);
    String stringPayload = "<deleteDataFromURL xmlns=\"http://jaxrs.apache.org\"><data1>account</data1></deleteDataFromURL>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("http://jaxrs.apache.org", "return"));
    assertEquals("account deleted", returnElem.getText());
}

89. ArchiveDeploymentTest#testGetDataFromURLandBody()

Project: axis2-java
File: ArchiveDeploymentTest.java
public void testGetDataFromURLandBody() throws Exception {
    Options options = TestUtil.getArchiveTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/getFromBody/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_GET);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getArchiveTestServiceClient(options);
    String stringPayload = "<addDataFromURLandBody xmlns=\"http://jaxrs.apache.org\"><data1>account</data1><data2>password</data2></addDataFromURLandBody>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("http://jaxrs.apache.org", "return"));
    assertEquals("account and password read", returnElem.getText());
}

90. ArchiveDeploymentTest#testGetDataFromURL()

Project: axis2-java
File: ArchiveDeploymentTest.java
public void testGetDataFromURL() throws Exception {
    Options options = TestUtil.getArchiveTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/get/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_GET);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getArchiveTestServiceClient(options);
    String stringPayload = "<getDataFromURL xmlns=\"http://jaxrs.apache.org\"><data1>account</data1></getDataFromURL>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("http://jaxrs.apache.org", "return"));
    assertEquals("account read", returnElem.getText());
}

91. ArchiveDeploymentTest#testUpdateDataFromURLandBody()

Project: axis2-java
File: ArchiveDeploymentTest.java
public void testUpdateDataFromURLandBody() throws Exception {
    Options options = TestUtil.getArchiveTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/getFromBody/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_PUT);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getArchiveTestServiceClient(options);
    String stringPayload = "<addDataFromURLandBody xmlns=\"http://jaxrs.apache.org\"><data1>account</data1><data2>password</data2></addDataFromURLandBody>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("http://jaxrs.apache.org", "return"));
    assertEquals("account and password updated", returnElem.getText());
}

92. ArchiveDeploymentTest#testUpdateDataFromURL()

Project: axis2-java
File: ArchiveDeploymentTest.java
public void testUpdateDataFromURL() throws Exception {
    Options options = TestUtil.getArchiveTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/update/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_PUT);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getArchiveTestServiceClient(options);
    String stringPayload = "<addDataFromURL xmlns=\"http://jaxrs.apache.org\"><data1>account</data1></addDataFromURL>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("http://jaxrs.apache.org", "return"));
    assertEquals("account updated", returnElem.getText());
}

93. ArchiveDeploymentTest#testAddDataFromURLandBody()

Project: axis2-java
File: ArchiveDeploymentTest.java
public void testAddDataFromURLandBody() throws Exception {
    Options options = TestUtil.getArchiveTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/getFromBody/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_POST);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getArchiveTestServiceClient(options);
    String stringPayload = "<addDataFromURLandBody xmlns=\"http://jaxrs.apache.org\"><data1>account</data1><data2>password</data2></addDataFromURLandBody>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("http://jaxrs.apache.org", "return"));
    assertEquals("account and password created", returnElem.getText());
}

94. ArchiveDeploymentTest#testAddDataFromURL()

Project: axis2-java
File: ArchiveDeploymentTest.java
/**
     * 
     * @throws Exception
     */
public void testAddDataFromURL() throws Exception {
    Options options = TestUtil.getArchiveTestOptions();
    // setting test case dependent settings
    options.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "testroot/add/{data1}");
    options.setProperty(Constants.Configuration.HTTP_METHOD, Constants.Configuration.HTTP_METHOD_POST);
    options.setProperty(Constants.Configuration.CONTENT_TYPE, Constants.MIME_CT_TEXT_XML);
    ServiceClient sender = TestUtil.getArchiveTestServiceClient(options);
    String stringPayload = "<addDataFromURL xmlns=\"http://jaxrs.apache.org\"><data1>account</data1></addDataFromURL>";
    OMElement payload = AXIOMUtil.stringToOM(stringPayload);
    OMElement respond = sender.sendReceive(payload);
    OMElement returnElem = respond.getFirstChildWithName(new QName("http://jaxrs.apache.org", "return"));
    assertEquals("account created", returnElem.getText());
}

95. AxisService2WSDL20#getServiceElement()

Project: axis2-java
File: AxisService2WSDL20.java
/**
     * Generates the service element for the service
     *
     * @param wsdl the WSDL namespace
     * @param tns the target namespace
     * @param omFactory the active OMFactory
     * @param interfaceName the name of the interface
     * @return the generated service element
     */
private OMElement getServiceElement(OMNamespace wsdl, OMNamespace tns, OMFactory omFactory, String interfaceName) {
    OMElement serviceElement = omFactory.createOMElement(WSDL2Constants.SERVICE_LOCAL_NAME, wsdl);
    serviceElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.ATTRIBUTE_NAME, null, serviceName));
    serviceElement.addAttribute(omFactory.createOMAttribute(WSDL2Constants.INTERFACE_LOCAL_NAME, null, tns.getPrefix() + ":" + interfaceName));
    return serviceElement;
}

96. JSONOMBuilderTest#testBadgerfishOMSerialization2()

Project: axis2-java
File: JSONOMBuilderTest.java
public void testBadgerfishOMSerialization2() throws XMLStreamException, JSONException, IOException, ParserConfigurationException, SAXException {
    String jsonString = getBadgerfishJSONString();
    ByteArrayInputStream inStream = new ByteArrayInputStream(jsonString.getBytes());
    MessageContext msgCtx = new MessageContext();
    Builder omBuilder = new JSONBadgerfishOMBuilder();
    OMElement elem = omBuilder.processDocument(inStream, JSONTestConstants.CONTENT_TYPE_BADGERFISH, msgCtx);
    elem.toString();
    ByteArrayOutputStream outStream = new ByteArrayOutputStream();
    elem.serialize(outStream);
    outStream.flush();
    outStream.close();
}

97. JSONIntegrationTest#doEchoOM()

Project: axis2-java
File: JSONIntegrationTest.java
private void doEchoOM(String messageType, String httpMethod) throws Exception {
    OMElement payload = createEnvelope();
    Options options = new Options();
    options.setTo(server.getEndpointReference("EchoXMLService"));
    options.setProperty(Constants.Configuration.MESSAGE_TYPE, messageType);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setProperty(Constants.Configuration.HTTP_METHOD, httpMethod);
    //        ConfigurationContext clientConfigurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
    ServiceClient sender = new ServiceClient(server.getConfigurationContext(), null);
    options.setAction(null);
    sender.setOptions(options);
    OMElement result = sender.sendReceive(payload);
    OMElement ele = (OMElement) result.getFirstOMChild();
    compareWithCreatedOMText(ele.getText());
}

98. RahasSAMLTokenV1205Test#validateRsponse()

Project: rampart
File: RahasSAMLTokenV1205Test.java
public void validateRsponse(OMElement resp) {
    OMElement rstr = resp.getFirstChildWithName(new QName(RahasConstants.WST_NS_05_12, RahasConstants.LocalNames.REQUEST_SECURITY_TOKEN_RESPONSE));
    assertNotNull("RequestedSecurityToken missing", rstr);
    OMElement rst = rstr.getFirstChildWithName(new QName(RahasConstants.WST_NS_05_12, RahasConstants.IssuanceBindingLocalNames.REQUESTED_SECURITY_TOKEN));
    assertNotNull("RequestedSecurityToken missing", rst);
    OMElement elem = rst.getFirstChildWithName(new QName(RahasConstants.SAML_NS, "Assertion"));
    assertNotNull("Missing SAML Assertoin", elem);
}

99. RahasSAMLTokenUTForBearerV1205Test#validateRsponse()

Project: rampart
File: RahasSAMLTokenUTForBearerV1205Test.java
public void validateRsponse(OMElement resp) {
    OMElement rstr = resp.getFirstChildWithName(new QName(RahasConstants.WST_NS_05_12, RahasConstants.LocalNames.REQUEST_SECURITY_TOKEN_RESPONSE));
    assertNotNull("RequestedSecurityToken missing", rstr);
    OMElement rst = rstr.getFirstChildWithName(new QName(RahasConstants.WST_NS_05_12, RahasConstants.IssuanceBindingLocalNames.REQUESTED_SECURITY_TOKEN));
    assertNotNull("RequestedSecurityToken missing", rst);
    OMElement elem = rst.getFirstChildWithName(new QName(RahasConstants.SAML_NS, "Assertion"));
    assertNotNull("Missing SAML Assertoin", elem);
}

100. RahasSAMLTokenCertForHoKV1205Test#validateRsponse()

Project: rampart
File: RahasSAMLTokenCertForHoKV1205Test.java
public void validateRsponse(OMElement resp) {
    OMElement rstr = resp.getFirstChildWithName(new QName(RahasConstants.WST_NS_05_12, RahasConstants.LocalNames.REQUEST_SECURITY_TOKEN_RESPONSE));
    assertNotNull("RequestedSecurityToken missing", rstr);
    OMElement rst = rstr.getFirstChildWithName(new QName(RahasConstants.WST_NS_05_12, RahasConstants.IssuanceBindingLocalNames.REQUESTED_SECURITY_TOKEN));
    assertNotNull("RequestedSecurityToken missing", rst);
    OMElement elem = rst.getFirstChildWithName(new QName(RahasConstants.SAML_NS, "Assertion"));
    assertNotNull("Missing SAML Assertoin", elem);
}