Package org.apache.ws.commons.om

Examples of org.apache.ws.commons.om.OMElement.addAttribute()


                    OMFactory omFactory = OMAbstractFactory.getOMFactory();
                    OMElement omElement = omFactory.createOMElement((QName) o, null);
                    OMNamespace omNamespace = omFactory.createOMNamespace(NIL_QNAME.getNamespaceURI(),
                            NIL_QNAME.getPrefix());
                    omElement.declareNamespace(omNamespace);
                    omElement.addAttribute(NIL_QNAME.getLocalPart(),
                            "true",
                            omNamespace);
                    childPullParser = omElement.getXMLStreamReader();

                    // here we are injecting one additional element. So need to accomodate that.
View Full Code Here


    }

    public static OMElement getParameter(String name, String value, boolean locked) {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMElement parameter = fac.createOMElement("parameter", null);
        parameter.addAttribute("name", name, null);
        parameter.addAttribute("locked", Boolean.toString(locked), null);
        parameter.setText(value);
        return parameter;
    }
}
View Full Code Here

    public static OMElement getParameter(String name, String value, boolean locked) {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMElement parameter = fac.createOMElement("parameter", null);
        parameter.addAttribute("name", name, null);
        parameter.addAttribute("locked", Boolean.toString(locked), null);
        parameter.setText(value);
        return parameter;
    }
}
View Full Code Here

        method.declareNamespace("http://www.w3.org/1999/XMLSchema-instance",
                "xsi");
        method.declareNamespace("http://www.w3.org/1999/XMLSchema", "xsd");

        //reqEnv.getBody().addChild(method);
        method.addAttribute("soapenv:encodingStyle",
                "http://schemas.xmlsoap.org/soap/encoding/",
                null);
        OMElement value1 = omfactory.createOMElement("key", emptyNs);
        OMElement value2 = omfactory.createOMElement("phrase", emptyNs);
        value1.addAttribute("xsi:type", "xsd:string", null);
View Full Code Here

                "http://schemas.xmlsoap.org/soap/encoding/",
                null);
        OMElement value1 = omfactory.createOMElement("key", emptyNs);
        OMElement value2 = omfactory.createOMElement("phrase", emptyNs);
        value1.addAttribute("xsi:type", "xsd:string", null);
        value2.addAttribute("xsi:type", "xsd:string", null);
        value1.addChild(
                omfactory.createText(value1, PropertyLoader.getGoogleKey()));
        value2.addChild(omfactory.createText(value2, word));

        method.addChild(value1);
View Full Code Here

        operation =
                omFactory.createOMElement("doGoogleSearch",
                        "urn:GoogleSearch",
                        "ns1");
        envelope.getBody().addChild(operation);
        operation.addAttribute("soapenv:encordingStyle",
                "http://schemas.xmlsoap.org/soap/encoding/", null);

        operation.addChild(
                getOMElement(omFactory,
                        defNs,
View Full Code Here

    }

    private static OMElement getOMElement(OMFactory factory, OMNamespace ns, String elementName,
                                          String type, String text) {
        OMElement part = factory.createOMElement(elementName, ns);
        part.addAttribute("xsi:type", type, null);
        part.addChild(factory.createText(text));
        return part;
    }
}
View Full Code Here

        }

        //adding one more child with the given attr
        employee = factory.createOMElement("Employee", testNamespace, documentElement);
        name = factory.createOMElement("Name", testNamespace);
        name.addAttribute("myAttr", "Un-Related Value", testNamespace);
        name.setText("Apache Developer");
        employee.addChild(name);

        return documentElement;
    }
View Full Code Here

                "http://www.w3.org/2003/06/xmlmime", "m", fac);

        OMElement text = new OMElementImpl("name", dataName, fac);
        OMAttribute cType1 = new OMAttributeImpl("contentType", mime,
                "text/plain", fac);
        text.addAttribute(cType1);
        byte[] byteArray = new byte[]{13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
                                      98};
        dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
        OMTextImpl textData = new OMTextImpl(dataHandler, false, fac);
View Full Code Here

                                envelope, addressingNamespaceObject);
            }

            if (relatesToHeader != null)
                if ("".equals(relatesTo.getRelationshipType())) {
                    relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
                            Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE,
                            addressingNamespaceObject);
                } else {
                    relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
                            relatesTo.getRelationshipType(),
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.