Package org.apache.ws.commons.om

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


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

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


        expectedDH = new DataHandler(dataSource);
        OMText binaryNode = new OMTextImpl(expectedDH, true, fac);

        envelope.addChild(body);
        body.addChild(data);
        data.addChild(binaryNode);

        envelope.serializeAndConsume(new FileOutputStream(outBase64File), baseOutputFormat);
        envelope.serializeAndConsume(new FileOutputStream(outMTOMFile), mtomOutputFormat);
    }
View Full Code Here

        OMTextImpl textData = new OMTextImpl(dataHandler, false, fac);

        envelope.addChild(body);
        body.addChild(data);
        data.addChild(text);
        text.addChild(textData);
    }

    /*
     * @see TestCase#tearDown()
     */
 
View Full Code Here

        OMElement root = factory.createOMElement("root", ns1);
        OMNamespace ns2 = root.declareNamespace("bar", "y");
        OMElement elt1 = factory.createOMElement("foo", ns1);
        OMElement elt2 = factory.createOMElement("yuck", ns2);
        OMText txt1 = factory.createText(elt2, "blah");
        elt2.addChild(txt1);
        elt1.addChild(elt2);
        root.addChild(elt1);
        root.serialize(writer);
    }
View Full Code Here

        if (inputParamClass.equals(String.class)) {
            returnElement.addChild(
                    fac.createText(returnElement, value.toString()));
        } else if (inputParamClass.equals(Integer.class)) {
            returnElement.addChild(
                    fac.createText(
                            returnElement,
                            String.valueOf(((Integer) value).intValue())));
        } else if (inputParamClass.equals(Float.class)) {
            returnElement.addChild(
View Full Code Here

            returnElement.addChild(
                    fac.createText(
                            returnElement,
                            String.valueOf(((Integer) value).intValue())));
        } else if (inputParamClass.equals(Float.class)) {
            returnElement.addChild(
                    fac.createText(
                            returnElement,
                            String.valueOf(((Float) value).floatValue())));
        } else if (inputParamClass.equals(Double.class)) {
            returnElement.addChild(
View Full Code Here

            returnElement.addChild(
                    fac.createText(
                            returnElement,
                            String.valueOf(((Float) value).floatValue())));
        } else if (inputParamClass.equals(Double.class)) {
            returnElement.addChild(
                    fac.createText(
                            returnElement,
                            String.valueOf(((Double) value).doubleValue())));
            //todo this seems to be a long list... need to complete this
        } else if (inputParamClass.equals(OMElement.class)) {
View Full Code Here

                    fac.createText(
                            returnElement,
                            String.valueOf(((Double) value).doubleValue())));
            //todo this seems to be a long list... need to complete this
        } else if (inputParamClass.equals(OMElement.class)) {
            returnElement.addChild((OMElement) value);
        } else {
            returnElement.addChild(
                    fac.createText(returnElement, value.toString()));
        }
        return returnElement;
View Full Code Here

                            String.valueOf(((Double) value).doubleValue())));
            //todo this seems to be a long list... need to complete this
        } else if (inputParamClass.equals(OMElement.class)) {
            returnElement.addChild((OMElement) value);
        } else {
            returnElement.addChild(
                    fac.createText(returnElement, value.toString()));
        }
        return returnElement;
    }
View Full Code Here

                OMElement responseElement =
                    fac.createOMElement(methodName + "Response", ns);
                String outMessageString = obj.toString();
                // System.out.println("outMessageString = " + outMessageString);
                // responseElement.setText(outMessageString);
                responseElement.addChild(getpayLoad(outMessageString));
                envelope.getBody().addChild(responseElement);
                outMessage.setEnvelope(envelope);
            }
        } catch (Exception e) {
            throw new AxisFault(e);
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.