Examples of OMElementImpl


Examples of org.apache.axiom.om.impl.llom.OMElementImpl

            // We want to set the om element and its parents to complete to
            // shutdown the parsing. 
            if (setComplete) {
               
                // Get the root of the document
                OMElementImpl root = (OMElementImpl) om;
                while(root.getParent() instanceof OMElementImpl) {
                    root = (OMElementImpl) root.getParent();
                }
               
                try {  
                    if (!root.isComplete() && root.getBuilder() != null &&
                            !root.getBuilder().isCompleted()) {
                        // Forward the parser to the end so it will close
                        while (root.getBuilder().next() != XMLStreamConstants.END_DOCUMENT) {
                            //do nothing
                        }                   
                    }
                } catch (Exception e) {
                    // Log and continue
View Full Code Here

Examples of org.apache.axiom.om.impl.llom.OMElementImpl

        OMElement element = msgCtxt.getEnvelope().getBody().getFirstElement();
        try {
            //Mapped format cannot handle element with namespaces.. So cannot handle Faults
            if (element instanceof SOAPFault && this instanceof JSONMessageFormatter) {
                SOAPFault fault = (SOAPFault)element;
                OMElement element2 = new OMElementImpl("Fault", null, element.getOMFactory());
                element2.setText(fault.toString());
                element = element2;
            }
            if (element instanceof OMSourcedElementImpl &&
                    getStringToWrite(((OMSourcedElementImpl)element).getDataSource()) != null) {
                String jsonToWrite =
View Full Code Here

Examples of org.apache.axiom.om.impl.llom.OMElementImpl

        SOAPFaultDetail detail = getDetail();
        if (getDetail() == null) {
            detail = getNewSOAPFaultDetail(this);
            setDetail(detail);
        }
        OMElement faultDetailEnty = new OMElementImpl(
                SOAPConstants.SOAP_FAULT_DETAIL_EXCEPTION_ENTRY, null, detail,
                factory);
        faultDetailEnty.setText(sw.getBuffer().toString());
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.llom.OMElementImpl

        org.apache.axis2.om.impl.OMOutputImpl baseOutput = new OMOutputImpl(new FileOutputStream(outBase64File),
                false);

        OMNamespaceImpl soap = new OMNamespaceImpl(
                "http://schemas.xmlsoap.org/soap/envelope/", "soap");
        OMElement envelope = new OMElementImpl("Envelope", soap);
        OMElement body = new OMElementImpl("Body", soap);

        OMNamespaceImpl dataName = new OMNamespaceImpl(
                "http://www.example.org/stuff", "m");
        OMElement data = new OMElementImpl("data", dataName);

        expectedImage =
                new ImageIO().loadImage(
                        new FileInputStream(
                                getTestResourceFile(imageInFileName)));
        ImageDataSource dataSource = new ImageDataSource("WaterLilies.jpg",
                expectedImage);
        expectedDH = new DataHandler(dataSource);
        OMText binaryNode = new OMTextImpl(expectedDH, true);

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

        envelope.serialize(baseOutput);
        baseOutput.flush();

        envelope.serialize(mtomOutput);
View Full Code Here

Examples of org.apache.axis2.om.impl.llom.OMElementImpl

        getDetail();
        if (getDetail() == null) {
            setDetail(getNewSOAPFaultDetail(this));

        }
        OMElement faultDetailEnty = new OMElementImpl(
                SOAPConstants.SOAP_FAULT_DETAIL_EXCEPTION_ENTRY,
                this.getNamespace());
        faultDetailEnty.setText(sw.getBuffer().toString());
        getDetail().addChild(faultDetailEnty);
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.llom.OMElementImpl

     * @return Returns OMElement.
     * @throws OMException
     */
    public OMElement createOMElement(QName qname, OMContainer parent)
            throws OMException {
        return new OMElementImpl(qname, parent);
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.llom.OMElementImpl

     * @param localName
     * @param ns
     * @return Returns OMElement.
     */
    public OMElement createOMElement(String localName, OMNamespace ns) {
        return new OMElementImpl(localName, ns);
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.llom.OMElementImpl

    public OMElement createOMElement(String localName, OMNamespace ns) {
        return new OMElementImpl(localName, ns);
    }

    public OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent) {
        return new OMElementImpl(localName, ns, parent);
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.llom.OMElementImpl

     * @return Returns OMElement.
     */
    public OMElement createOMElement(String localName, OMNamespace ns,
                                     OMContainer parent,
                                     OMXMLParserWrapper builder) {
        return new OMElementImpl(localName, ns, parent,
                builder);
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.llom.OMElementImpl

        OMOutputFormat baseOutputFormat = new OMOutputFormat();
        baseOutputFormat.setDoOptimize(false);

        OMNamespaceImpl soap = new OMNamespaceImpl(
                "http://schemas.xmlsoap.org/soap/envelope/", "soap");
        OMElement envelope = new OMElementImpl("Envelope", soap);
        OMElement body = new OMElementImpl("Body", soap);

        OMNamespaceImpl dataName = new OMNamespaceImpl(
                "http://www.example.org/stuff", "m");
        OMElement data = new OMElementImpl("data", dataName);

        expectedImage =
                new ImageIO().loadImage(
                        new FileInputStream(
                                getTestResourceFile(imageInFileName)));
        ImageDataSource dataSource = new ImageDataSource("WaterLilies.jpg",
                expectedImage);
        expectedDH = new DataHandler(dataSource);
        OMText binaryNode = new OMTextImpl(expectedDH, true);

        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
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.