Package org.apache.axiom.soap.impl.builder

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


        String[] contentIDs = attachments.getAllContentIDs();
       
        // Get the root
        XMLStreamReader reader =
                StAXUtils.createXMLStreamReader(new BufferedReader(new InputStreamReader(attachments.getSOAPPartInputStream())));
        MTOMStAXSOAPModelBuilder builder =
            new MTOMStAXSOAPModelBuilder(reader, attachments, null);
        OMElement root = builder.getDocumentElement();
        StringWriter xmlWriter = new StringWriter();
        root.serialize(xmlWriter);
       
        // Serialize the message using the legacy behavior (order by content id)
        OMOutputFormat format = new OMOutputFormat();
View Full Code Here


        String[] contentIDs = attachments.getAllContentIDs();
       
        // Get the root
        XMLStreamReader reader =
                StAXUtils.createXMLStreamReader(new BufferedReader(new InputStreamReader(attachments.getSOAPPartInputStream())));
        MTOMStAXSOAPModelBuilder builder =
            new MTOMStAXSOAPModelBuilder(reader, attachments, null);
        OMElement root = builder.getDocumentElement();
        StringWriter xmlWriter = new StringWriter();
        root.serialize(xmlWriter);
       
        // Serialize the message using the legacy behavior (order by content id)
        OMOutputFormat format = new OMOutputFormat();
View Full Code Here

          & null != soapEnvelopeNamespaceURI) {

        /*
         * Creates the MTOM specific MTOMStAXSOAPModelBuilder
         */
        builder = new MTOMStAXSOAPModelBuilder(streamReader,
            attachments, soapEnvelopeNamespaceURI);

      } else if (attachments.getAttachmentSpecType().equals(
          MTOMConstants.SWA_TYPE)
          & null != soapEnvelopeNamespaceURI) {
View Full Code Here

        return internalCreateStAXSOAPModelBuilder(createXMLStreamReader(configuration, is));
    }

    public SOAPModelBuilder createSOAPModelBuilder(StAXParserConfiguration configuration,
            SOAPFactory soapFactory, InputSource rootPart, MimePartProvider mimePartProvider) {
        MTOMStAXSOAPModelBuilder builder = new MTOMStAXSOAPModelBuilder(soapFactory, createXMLStreamReader(
                configuration, rootPart), mimePartProvider);
        builder.releaseParserOnClose(true);
        return builder;
    }
View Full Code Here

        return builder;
    }

    public SOAPModelBuilder createSOAPModelBuilder(StAXParserConfiguration configuration,
            SOAPFactory soapFactory, InputSource rootPart, MimePartProvider mimePartProvider) {
        MTOMStAXSOAPModelBuilder builder = new MTOMStAXSOAPModelBuilder(soapFactory, createXMLStreamReader(
                configuration, rootPart), mimePartProvider);
        builder.setAutoClose(true);
        return builder;
    }
View Full Code Here

            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

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

            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

        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.getRootPartInputStream()), attachments);
        OMElement bodyElement = builder.getSOAPEnvelope().getBody().getFirstElement();
        assertBeanEquals(expectedResult, ADBBeanUtil.parse(bean.getClass(), cache ? bodyElement.getXMLStreamReader() : bodyElement.getXMLStreamReaderWithoutCaching()));
    }
View Full Code Here

        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.getRootPartInputStream()), attachments);
        OMElement bodyElement = builder.getSOAPEnvelope().getBody().getFirstElement();
        assertBeanEquals(expectedResult, ADBBeanUtil.parse(bean.getClass(), bodyElement.getXMLStreamReaderWithoutCaching()));
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder

Copyright © 2018 www.massapicom. 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.