Examples of MTOMStAXSOAPModelBuilder


Examples of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

        envelope.serialize(buffer, format);
//        envelope.serialize(System.out, format);
        String contentType = format.getContentTypeForMTOM("text/xml");
        Attachments attachments = new Attachments(new ByteArrayInputStream(buffer.toByteArray()), contentType);
        assertEquals(countDataHandlers(bean) + 1, attachments.getAllContentIDs().length);
        MTOMStAXSOAPModelBuilder builder = new MTOMStAXSOAPModelBuilder(StAXUtils.createXMLStreamReader(attachments.getSOAPPartInputStream()), attachments);
        OMElement bodyElement = builder.getSOAPEnvelope().getBody().getFirstElement();
        assertBeanEquals(expectedResult, ADBBeanUtil.parse(bean.getClass(), cache ? bodyElement.getXMLStreamReader() : bodyElement.getXMLStreamReaderWithoutCaching()));
    }
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

        rootPartWriter.close();
        mpWriter.complete();
//        System.out.write(buffer.toByteArray());
        String contentType = format.getContentTypeForMTOM("text/xml");
        Attachments attachments = new Attachments(new ByteArrayInputStream(buffer.toByteArray()), contentType);
        MTOMStAXSOAPModelBuilder builder = new MTOMStAXSOAPModelBuilder(StAXUtils.createXMLStreamReader(attachments.getSOAPPartInputStream()), attachments);
        OMElement bodyElement = builder.getSOAPEnvelope().getBody().getFirstElement();
        assertBeanEquals(expectedResult, ADBBeanUtil.parse(bean.getClass(), bodyElement.getXMLStreamReaderWithoutCaching()));
    }
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

        if (isSOAP) {
            if (attachments.getAttachmentSpecType().equals(
                    MTOMConstants.MTOM_TYPE)) {
                //Creates the MTOM specific MTOMStAXSOAPModelBuilder
                builder = new MTOMStAXSOAPModelBuilder(streamReader,
                                                       attachments, soapEnvelopeNamespaceURI);
                msgContext.setDoingMTOM(true);
            } else if (attachments.getAttachmentSpecType().equals(
                    MTOMConstants.SWA_TYPE)) {
                builder = new StAXSOAPModelBuilder(streamReader,
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

            PushbackInputStream pis = BuilderUtil.getPushbackInputStream(inputStream);
            String actualCharSetEncoding = BuilderUtil.getCharSetEncoding(pis, charSetEncoding);
           
            // Get the XMLStreamReader for this input stream
            streamReader = StAXUtils.createXMLStreamReader(StAXParserConfiguration.SOAP, pis, actualCharSetEncoding);       
            StAXBuilder builder = new MTOMStAXSOAPModelBuilder(streamReader,
                    attachments);
            SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
            BuilderUtil
                    .validateSOAPVersion(BuilderUtil.getEnvelopeNamespace(contentType), envelope);
            BuilderUtil.validateCharSetEncoding(charSetEncoding, builder.getDocument()
                    .getCharsetEncoding(), envelope.getNamespace().getNamespaceURI());
            //Overriding the earlier setting by MIMEBuilder
            messageContext.setDoingSwA(false);
            messageContext.setDoingMTOM(true);
            return envelope;
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

        // Get a SOAP OM Builder.  Passing null causes the version to be automatically triggered
        StAXSOAPModelBuilder builder = null;
        if (attachments == null) {
            builder = new StAXSOAPModelBuilder(reader, null);
        } else {
            builder = new MTOMStAXSOAPModelBuilder(reader, attachments, null);
        }
        // Create and return the OM Envelope
        org.apache.axiom.soap.SOAPEnvelope omEnvelope = builder.getSOAPEnvelope();
       
        // TODO The following statement expands the OM tree.  This is
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

            throw new SOAPException(e);
        }

        StAXSOAPModelBuilder builder;
        if (isMTOM && attachments != null) {
            builder = new MTOMStAXSOAPModelBuilder(streamReader,
                                                   soapFactory,
                                                   attachments,
                                                   soapEnvelopeNamespaceURI);
        } else {
            builder = new StAXSOAPModelBuilder(streamReader,
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

                }
                attachments.addDataHandler(contentId, dh);
            }
        }
        OMElement docElem = (OMElement)message.getSOAPPart().getDocumentElement();
        MTOMStAXSOAPModelBuilder builder = new MTOMStAXSOAPModelBuilder(docElem.getXMLStreamReader(), attachments);
        return builder.getSOAPEnvelope();
    }
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

                    factory = new SOAP12Factory();
                }
                if (attachments.getAttachmentSpecType().equals(
                        MTOMConstants.MTOM_TYPE)) {
                    //Creates the MTOM specific MTOMStAXSOAPModelBuilder
                    builder = new MTOMStAXSOAPModelBuilder(streamReader,
                                                           factory,
                                                           attachments,
                                                           soapEnvelopeNamespaceURI);
                } else if (attachments.getAttachmentSpecType().equals(
                        MTOMConstants.SWA_TYPE)) {
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

        // Get a SOAP OM Builder.  Passing null causes the version to be automatically triggered
        StAXSOAPModelBuilder builder = null;
        if (attachments == null) {
            builder = new StAXSOAPModelBuilder(reader, null);
        } else {
            builder = new MTOMStAXSOAPModelBuilder(reader, attachments, null);
        }
        // Create and return the OM Envelope
        org.apache.axiom.soap.SOAPEnvelope omEnvelope = builder.getSOAPEnvelope();
       
        // TODO The following statement expands the OM tree.  This is
View Full Code Here

Examples of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

        if (isSOAP) {
            if (attachments.getAttachmentSpecType().equals(
                    MTOMConstants.MTOM_TYPE)) {
                //Creates the MTOM specific MTOMStAXSOAPModelBuilder
                builder = new MTOMStAXSOAPModelBuilder(streamReader,
                                                       attachments, soapEnvelopeNamespaceURI);
                msgContext.setDoingMTOM(true);
            } else if (attachments.getAttachmentSpecType().equals(
                    MTOMConstants.SWA_TYPE)) {
                builder = new StAXSOAPModelBuilder(streamReader,
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.